Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits\stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- string s;
- cin >> s;
- int i, cnt = 0;
- for(i = 0; i < n - 2; i++)
- {
- if(s[i] == 'x' && s[i+1] == 'x' && s[i+2] == 'x') cnt++;
- }
- cout << cnt << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement