# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
201572 |
2020-02-11T06:54:48 Z |
SamAnd |
Imena (COCI16_imena) |
C++17 |
|
5 ms |
376 KB |
#include <bits/stdc++.h>
using namespace std;
int nn;
int main()
{
cin >> nn;
int q = 0;
int ans = 0;
while (1)
{
int n;
string a;
cin >> a;
n = a.size();
bool z = true;
if (!('A' <= a[0] && a[0] <= 'Z'))
z = false;
for (int i = 1; i < n; ++i)
{
if (a[n - 1] == '.' || a[n - 1] == '?' || a[n - 1] == '!')
continue;
if (!('a' <= a[i] && a[i] <= 'z'))
z = false;
}
if (z)
++ans;
if (a[n - 1] == '.' || a[n - 1] == '?' || a[n - 1] == '!')
{
cout << ans << endl;
++q;
ans = 0;
if (q == nn)
break;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
376 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
376 KB |
Output is correct |
5 |
Correct |
5 ms |
376 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
376 KB |
Output is correct |
10 |
Correct |
5 ms |
376 KB |
Output is correct |