답안 #397531

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
397531 2021-05-02T10:33:37 Z Iwanttobreakfree Imena (COCI16_imena) C++
45 / 50
1 ms 208 KB
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
	int n,j=0;
	bool num;
	string str;
	cin>>n;
	vector<int>v(n,0);
	while(cin>>str){
	int k=str.length();
	if(str[0]>='A'&&str[0]<='Z'){
		num=false;
	for(int i=1;i<k;i++){
		if(str[i]>='1'&&str[i]<='9')num=true;
		if(str[i]>='A'&&str[i]<='Z')num=true;
	}
	if(!num)v[j]++;
}
	if(str[k-1]=='.'||str[k-1]=='?'||str[k-1]=='!')j++;
	if(j==n)break;
}
	for(int i=0;i<n;i++)cout<<v[i]<<'\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Incorrect 1 ms 204 KB Output isn't correct