# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
443544 | 2021-07-10T17:52:31 Z | penguinhacker | Imena (COCI16_imena) | C++14 | 1 ms | 204 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array bool punc(char c) { return c=='.'||c=='?'||c=='!'; } int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; string s; int ans=0; while(n&&(cin >> s)) { bool name=isupper(s[0]); for (int i=1; name&&i<s.size()&&!punc(s[i]); ++i) name&='a'<=s[i]&&s[i]<='z'; ans+=name; if (punc(s.back())) { cout << ans << "\n"; ans=0, --n; } } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Correct | 0 ms | 204 KB | Output is correct |
7 | Correct | 0 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 0 ms | 204 KB | Output is correct |
10 | Correct | 0 ms | 204 KB | Output is correct |