Submission #883654

# Submission time Handle Problem Language Result Execution time Memory
883654 2023-12-05T15:54:03 Z vjudge1 Imena (COCI16_imena) C++17
50 / 50
1 ms 604 KB
#include <bits/stdc++.h>
using namespace std;
#define sp << " " << 
#define int long long
#define vi vector<int>
#define F(xxx,yyy) for (int xxx=1;xxx<=yyy;xxx++)
#define pii pair<int,int>
const int N = 1e5+1;

void solve() {
  int c;
  cin >> c;
  while (c--) {
    int ans = 0;
    while (1) {
      bool cool = 1;
      string s;
      cin >> s;
      bool num = 0;
      for (auto it : s) if (it >= '0' && it <= '9') num = 1;
      if (num) cool = 0;
      if (s[0]< 'A' || s[0] > 'Z') cool = 0;
      if (cool) ans++;
      if (s.back() == '.' || s.back() == '?' || s.back() == '!') break;
    }
    cout << ans << endl;
  }
}
    
                  
                             
signed main() { 
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  #ifdef Local
  freopen("in","r",stdin);
  freopen("out","w",stdout); 
  #endif
  int t = 1;
  //cin >> t;
	F(i,t) solve();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct