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