#include
(5488)#include

using namespace std;
int jishu(string str) {
int n = str.size();
cout << n << endl;
cout << str<< endl;
int flag = 0;
for (int i = 0; i < n; i++) {
char a = str[i];
if (str[i] != ' ') {
flag++;
}
else flag = 0;
}
return flag;
}

int main() {
string str = {0};
cout << "请输入字符串!" << endl;
//cin >> str;
getline(cin,str);
int n = jishu(str);
cout << n << endl;
return 0;
}
全部评论

相关推荐

点赞 评论 收藏
转发
2 收藏 评论
分享
牛客网
牛客企业服务