# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201572 | SamAnd | Imena (COCI16_imena) | C++17 | 5 ms | 376 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;
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 |
---|---|---|---|---|
Fetching results... |