Submission #201572

#TimeUsernameProblemLanguageResultExecution timeMemory
201572SamAndImena (COCI16_imena)C++17
50 / 50
5 ms376 KiB
#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 timeMemoryGrader output
Fetching results...