Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. int nrap[10], ma, ima;
  5. unsigned int i;
  6. char sir[256], cifre[11] = "0123456789";
  7. int main ()
  8. {
  9. cin.get (sir, 256);
  10. for (i=0;i<strlen(sir);i++)
  11. if (strchr(cifre,sir[i]))
  12. nrap[(int)sir[i]-(int)'0']++;
  13. for (i = 0; i<=9;i++)
  14. if (nrap[i] > ma)
  15. {
  16. ma = nrap[i];
  17. ima = i;
  18. }
  19. if (ma == 0)
  20. cout << "NU" << '\n';
  21. else
  22. cout << ima << '\n';
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement