Advertisement
rengetsu

Codeforces_266A

Jul 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. //Codeforces Round 266A
  2. #include <string>
  3. #include <cstring>
  4. #include <iostream>
  5. using namespace std;
  6. int main()
  7. {
  8.     int n, answ=0, ch=0;
  9.     string s;
  10.     char mass[51];
  11.     cin >> n >> s;
  12.     strcpy(mass, s.c_str());
  13.     for(int i=0;i<n;i++)
  14.     {
  15.         if(mass[i]==mass[i+1])
  16.         {
  17.             answ++;
  18.         }
  19.     }
  20.     cout << answ;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement