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[105],y[105],*p,r[105];
- int ap[105];
- int main ()
- {
- int n,ma,b,i,j;
- ma=INT_MIN;
- cin.getline(x,105);
- p=strtok(x," ");
- while(p!=0)
- {
- for(i=0;i<strlen(p);i++)
- {
- ap[p[i]-48]++;
- }
- p=strtok(0," ");
- }
- for(i=0;i<=9;i++)
- {
- if(ap[i]>ma)
- {
- ma=ap[i];
- n=i;
- }
- }
- cout<<n;
- }
- 59
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement