fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string s;
  7. cin >> s;
  8.  
  9. int odp = 0;
  10. int siz = s.size();
  11.  
  12. for (int i = 1; i < siz; ++i)
  13. {
  14. if (s[i] == s[i - 1])
  15. {
  16. ++odp;
  17. }
  18. }
  19.  
  20. cout << odp;
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.01s 5320KB
stdin
h
stdout
Standard output is empty