Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. string chuj;
  7. int count[26] = {0};
  8. int numb = 0;
  9. int i;
  10. cin >> chuj;
  11. for (i = 0;i < chuj.length();i++)
  12. {
  13. if (chuj[i]==chuj[i+1])
  14. {
  15. count[i]++;
  16. }
  17. }
  18. for (i = 0;i < 26;i++)
  19. {
  20. if (count[i] != 0)
  21. {
  22. numb++;
  23. }
  24. }
  25. cout<<"The ammount of repeating letters is\t" << numb << endl;
  26.  
  27. system("pause");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement