📄 stlstringdemo.cpp
字号:
#include <string>#include <iostream>int main() { using namespace std; string s1("This "), s2("is a "), s3("string."); s1 += s2; /* concatenation */ string s4 = s1 + s3; cout << s4 << endl; string s5("The length of that string is: "); cout << s5 << s4.length << " characters." << endl; cout << "Enter a sentence: " << endl; getline(cin, s2); cout << "Here is your sentence: \n" << s2 << endl; cout << "The length of it was: " << s2.length() << endl; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -