#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
cin >> s;
const char * p = s.c_str();
int len = 0;
while (*p++)
len++;
cout << "the length of string :" << len << endl;
system("pause");
return 0;
}
计算字符串的长度
最新推荐文章于 2024-03-14 12:41:42 发布