# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
883657 | vjudge1 | Imena (COCI16_imena) | C++17 | 0 ms | 400 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.
#pragma GCC optimize("unroll-loops,Ofast,O3")
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define spc << " " <<
#define endl "\n"
#define all(x) x.begin(), x.end()
#define int long long
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define st first
#define nd second
#define inf 1000000009
#define MOD 998244353
#define lim 200005
using namespace std;
void solve(){
int n; cin >> n;
int cnt=0;
int flag;
while(n--){
while(true){
string s; cin >> s;
flag=1;
if(s[0]-'A' >=0 && s[0]-'A'<=26){
for(int i=1; i<s.size()-1; i++){
if((s[i]-'a' <0 || s[i]-'a'>26)) flag=0;
}
if(s.size()>1 && (s[s.size()-1]!='.' && s[s.size()-1]!='?' && s[s.size()-1]!='!' && (s[s.size()-1]-'a' <0 || s[s.size()-1]-'a'>26))) flag=0;
}
else flag=0;
if(flag) cnt++;
if(s[s.size()-1]=='.' || s[s.size()-1]=='?' || s[s.size()-1]=='!'){
cout << cnt << endl;
cnt=0;
break;
}
}
}
}
signed main(){
ios_base::sync_with_stdio(false);cin.tie(0);
#ifdef Local
freopen("in","r",stdin);
freopen("out","w",stdout);
#endif
/*freopen("fcolor.in","r",stdin);
freopen("fcolor.out","w",stdout);*/
int t=1;
//cin >> t;
while(t--) solve();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |