# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
443544 | penguinhacker | Imena (COCI16_imena) | C++14 | 1 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |