统计单词 题解:
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
string str1;
vector<string>vec1;
while(cin>>str1){
if(str1[str1.size()-1]!='.'){
cout<<str1.size()<<" ";
}
else{
if(str1.size()==1) break;
cout<<str1.size()-1<<" ";
break;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发