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