文章

30

粉丝

0

获赞

16

访问

588

头像
统计单词 题解:
P1394 华中科技大学
发布于2026年1月29日 09:59
阅读数 8

#include<bits/stdc++.h>
using namespace std;
int main(){
	char c;
	int length = 0;
	while(cin.get(c)){
		if(c == '.'){
			if(length > 0)
				cout << length;
			cout << endl;
			length = 0;
		}	
		else{
			if(isspace(c)){
				if(length > 0){
					cout << length <<" ";
					length = 0;
				}
			}	
			else	
				length++;
		}			
	}	
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发