Advertisement
Denistod

Untitled

Nov 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. #include<climits>
  4. using namespace std;
  5. char x[105],y[105],*p,r[105];
  6. int ap[105];
  7. int main ()
  8. {
  9. int n,ma,b,i,j;
  10. ma=INT_MIN;
  11. cin.getline(x,105);
  12. p=strtok(x," ");
  13. while(p!=0)
  14. {
  15. for(i=0;i<strlen(p);i++)
  16. {
  17. ap[p[i]-48]++;
  18. }
  19. p=strtok(0," ");
  20. }
  21. for(i=0;i<=9;i++)
  22. {
  23. if(ap[i]>ma)
  24. {
  25. ma=ap[i];
  26. n=i;
  27. }
  28. }
  29. cout<<n;
  30. }
  31. 59
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement