#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;
}
计算字符串的长度
最新推荐文章于 2023-01-09 18:57:39 发布