Advertisement
Promi_38

cf 978B

Oct 5th, 2021
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include<bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.    
  10.     string s;
  11.     cin >> s;
  12.    
  13.     int i, cnt = 0;
  14.     for(i = 0; i < n - 2; i++)
  15.     {
  16.         if(s[i] == 'x' && s[i+1] == 'x' && s[i+2] == 'x') cnt++;
  17.     }
  18.     cout << cnt << endl;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement