5.6 输出字符串 srt.size()

程序来源 :C++ primer plus
章 节 :5.6
名 称 :forstr1.cpp
功 能 :输出字符串
开发时间 :2020-1-9
版 本 :v1.0
运行测试 :通过
C++11支持:执行工具-编译选项 输入
-std=c++11 并打钩

/********************************
 * 程序来源 :C++ primer plus
 * 章    节 :5.6
 * 名    称 :forstr1.cpp
 * 功    能 :输出字符串
 * 开发时间 :2020-1-9
 * 版    本 :v1.0
 * 运行测试 :通过
 * C++11支持:执行工具-编译选项 输入
 *            -std=c++11 并打钩
 *******************************/
#include 
#include 
 
using namespace std;

int main() {
    string str;
    cout << "Enter a string:";
    cin >> str;
    
    for(int i=0; i

运行结果:


/**********************************
 *            程序输出            *
 **********************************
Enter a string:asdfsafsdfsdfsafasfasdf
asdfsafsdfsdfsafasfasdf
 bye.

--------------------------------
Process exited after 4.354 seconds with return value 0
请按任意键继续. . .

**********************************/

声明:本代例子码源自教材非原创,是笔者的学习笔记,仅用于学习交流。

你可能感兴趣的:(5.6 输出字符串 srt.size())