Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string sch;
  8. char sample[30];
  9. char y, t;
  10. int a, max = 1;
  11. for(char t = 'a'; t <= 'z'; t++)
  12. {
  13. sample[t]=t;
  14. }
  15. cin>>sch;
  16. for (char j = 'a'; j <= 'z'; j++)
  17. {
  18. a = 0;
  19. for (int i = 0; i<=sch.length(); i++)
  20. {
  21. if(sch[i]=='\0')
  22. {
  23. if (a!=0){
  24. if (max < a)
  25. {
  26. max = a;
  27. cout<<y<<"="<<a<<endl;}
  28. }}
  29.  
  30. if (sch[i]==sample[j])
  31. {
  32. a++;
  33. y = sch[i];
  34. }
  35. }
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement