# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
317260 | fadi57 | Imena (COCI16_imena) | C++14 | 1 ms | 416 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const long long mx=2*1e5+5;
const long long mod=1e9+7;
typedef long long ll;
#define f first
#define s second
bool uper(char x){
return(x>='A'&&x<='Z');
}
bool lower(char x){
if(x=='.'||x=='?'||x=='!'){return 1;}
return(x>='a'&&x<='z');
}
bool endd(char x){
return (x=='.'||x=='?'||x=='!');
}
int main() {
int n;cin>>n;
int counter=0;
string s;
ll temp=0;
while(counter<n){
cin>>s;
int ss=s.size();
int b=0;
if(uper(s[0])){
for(int j=1;j<ss;j++){
if(!lower(s[j])){b=1;break;}
}if(b==0){temp++;}
}
if(endd(s[ss-1])){
cout<<temp<<endl;
temp=0;
counter++;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |