# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293948 | 7_7_7 | Imena (COCI16_imena) | C++17 | 1 ms | 384 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 n;
bool good(string s){
if(s.back() == '.') s.pop_back();
if(s.back() == '?') s.pop_back();
if(s.back() == '!') s.pop_back();
if('A' <= s[0] && s[0] <= 'Z'){
for(int i = 1; i < (int)s.size(); i ++){
if('a' <= s[i] && s[i] <= 'z') continue;
return false;
}
return true;
}
return false;
}
int main()
{
ios_base::sync_with_stdio(false);
cin >> n;
vector<int> res;
for(int i = 1; i <= n; i ++){
string s;
int cnt = 0;
while(true){
cin >> s;
cnt += (good(s) == true);
if(s.back() == '.' || s.back() == '?' || s.back() == '!') break;
}
res.push_back(cnt);
}
for(auto x: res) cout << x << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |