Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int t, n;
  7.     cin >> t;
  8.     for(int x = 1; x <= t; ++x) {
  9.         cin >> n;
  10.         string field;
  11.         cin >> field;
  12.         int ans = 0;
  13.         for(int i = 0; i < field.size(); ++i) {
  14.             if(field[i] == '.') {
  15.                 ans++;
  16.                 i += 2;
  17.             }
  18.         }
  19.         printf("Case %d: %d\n", x, ans);
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement