Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int ap[105];
- char x[55];
- int main()
- {
- int i,m=-1;
- cin.getline(x,55);
- for(i=0;i<=strlen(x)-1;i++)
- {
- if(x[i]>='0' && x[i]<='9')
- {
- ap[x[i]]++;
- }
- }
- for(i='0';i<='9';i++)
- {
- if(m<ap[i])
- {
- m=ap[i];
- //cout<<x[i];
- }
- }
- for(i='0';i<='9';i++)
- {
- if(m==ap[i])
- {
- // m=ap[i];
- //cout<<x[i];
- cout<<i-48;
- break;
- }
- }
- // cout<<m;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement