Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int nrap[10], ma, ima;
- unsigned int i;
- char sir[256], cifre[11] = "0123456789";
- int main ()
- {
- cin.get (sir, 256);
- for (i=0;i<strlen(sir);i++)
- if (strchr(cifre,sir[i]))
- nrap[(int)sir[i]-(int)'0']++;
- for (i = 0; i<=9;i++)
- if (nrap[i] > ma)
- {
- ma = nrap[i];
- ima = i;
- }
- if (ma == 0)
- cout << "NU" << '\n';
- else
- cout << ima << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement