Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t, n, l;
- char s[300001];
- scanf("%d",&t);
- while(t--){
- scanf("%s",&s);
- int x=0, y = 0;
- l = strlen(s);
- for(int i=0; i<l; i+=1){
- if((s[i]==120)&& (s[i+1]==121)) x++;
- else if((s[i]==121)&& (s[i+1]==120)) x++;
- }
- if(x>0)printf("%d\n",x);
- else printf("0\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement