文章
55
粉丝
100
获赞
12
访问
29.8k
#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
int main(){
string str;
while(getline(cin,str,'.')){
int len = str.length();
int count = 0;
for(int i = 0; i<len; i++){
if(str[i]!=' ' && str[i+1]!=' '){
count++;
// cout<<str[i];
if(i == len-1){
cout<<count<<endl;
}
}else if(str[i] == ' '&&str[i+1]!=' ' && i != 0){
cout<<++count<<" ";
count = 0;
}
}
char dot;
scanf("%c",&dot);
}
}
登录后发布评论
暂无评论,来抢沙发