文章

5

粉丝

409

获赞

7

访问

49.6k

头像
好坑的输入
P1394 华中科技大学
发布于2020年4月26日 13:12
阅读数 9.1k

#include<cstdio>
#include<cstring>
using namespace std;

int main()
{
	char str[5000];
	while(scanf("%c",&str[0])!=EOF)
	{
	gets(str+1);
	int num=0;
	
	for(int i=0;i<strlen(str);i++)
	{
		char c = str[i];
		
		switch(c)
		{
			case ' ':if(num) printf("%d ",num);num=0;
				break;
			case '.':
				goto end;
				break;
			default:num++;	
		}
		
	}
	end:
		if(num) printf("%d\n",num);
		
	str[0]='\0';//清空 
	}
	
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发