#include <iostream> #include <string> using namespace std; int main() { string text = "Hello C++"; cout << "原字符串: " << text << endl; cout << "字符串长度: " << text.length() << endl; cout
#include <iostream> #include <string> using namespace std; int main() { string text = "Hello C++"; cout << "原字符串: " << text << endl; cout << "字符串长度: " << text.length() << endl; cout