1.计算字符串长度
string s;
int len=s.length();
2.字符串输入
getline(cin,s);//可输入空格
3.string s;
for(char:s){}//可遍历字符串
暂无评论,快来抢首评~
相关推荐