//我是初学者
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int len=strlen(s);
cout<<len;
return 0;
}
string类型求字符串长度错误了
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
诺er~ 2021-08-19 18:08关注#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int len=s.length();//strlen是求字符数组长度的 cout<<len; return 0; }本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 2无用