Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- string sch;
- char sample[30];
- char y, t;
- int a, max = 1;
- for(char t = 'a'; t <= 'z'; t++)
- {
- sample[t]=t;
- }
- cin>>sch;
- for (char j = 'a'; j <= 'z'; j++)
- {
- a = 0;
- for (int i = 0; i<=sch.length(); i++)
- {
- if(sch[i]=='\0')
- {
- if (a!=0){
- if (max < a)
- {
- max = a;
- cout<<y<<"="<<a<<endl;}
- }}
- if (sch[i]==sample[j])
- {
- a++;
- y = sch[i];
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement