Submission #883657

#TimeUsernameProblemLanguageResultExecution timeMemory
883657vjudge1Imena (COCI16_imena)C++17
50 / 50
0 ms400 KiB
#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)

imena.cpp: In function 'void solve()':
imena.cpp:31:31: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |                 for(int i=1; i<s.size()-1; i++){
      |                              ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...