| 7 | using namespace std; |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | int testCases; |
| 12 | cin >> testCases; |
| 13 | while (testCases--) |
| 14 | { |
| 15 | string s; |
| 16 | cin >> s; |
| 17 | int ans = 0; |
| 18 | for (int i = 0; i < s.size() - 1; ++i) |
| 19 | { |
| 20 | if ((s[i] == 'x' and s[i + 1] == 'y') or (s[i] == 'y' and s[i + 1] == 'x')) |
| 21 | { |
| 22 | ans++; |
| 23 | i++; |
| 24 | } |
| 25 | } |
| 26 | cout << ans << '\n'; |
| 27 | } |
| 28 | |
| 29 | return 0; |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected