SHARE
TWEET

Untitled

a guest Oct 15th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define pb push_back
  5. #define F first
  6. #define S second
  7. #define double long double
  8. #define ll long long
  9. #define ull unsigned ll
  10. #define pii pair < int, int >
  11.  
  12. int main()
  13. {
  14.     ios_base::sync_with_stdio(0);
  15.     cin.tie(0);
  16.     cout.tie(0);
  17.     freopen("input.txt","r",stdin);
  18.     freopen("output.txt","w",stdout);
  19.     string s;
  20.     getline(cin, s);
  21.     int k = 0, z = 0, zzz = 0;
  22.     while (z < s.size())
  23.     {
  24.         if (zzz == 0 && s[z] >= 'A' && s[z] <= 'Z')
  25.         {
  26.             zzz++;
  27.             k++;
  28.         }
  29.         else if (s[z] >= 'a' && s[z] <= 'z')
  30.             zzz = 0;
  31.         else if (zzz > 0 && ((s[z] >= 'A' && s[z] <= 'Z') || (s[z] < 'A' || s[z] > 'Z')))
  32.         {
  33.             zzz++;
  34.             if (zzz == 10)
  35.                 zzz = 0;
  36.         }
  37.         z++;
  38.     }
  39.     cout << k;
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top