Advertisement
cupsamada

280

Nov 5th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include<iostream>
  2. #include<climits>
  3. using namespace std;
  4. int main()
  5. {
  6. int n, apare=0, x, ogl, maxim=INT_MIN, aux, contor=0;
  7. for(cin>>x; x!=0; cin>>x)
  8. {
  9. aux=x;
  10. ogl=0;
  11. while(aux>0)
  12. {
  13. ogl=ogl*10+x%10;
  14. x=x/10;
  15. }
  16. if(x==ogl)
  17. {
  18. contor++;
  19. if(x>maxim)
  20. {
  21. maxim=x;
  22. apare=1;
  23. }
  24. else
  25. {
  26. if(x==maxim)
  27. {
  28. apare++;
  29. }
  30. }
  31. }
  32.  
  33.  
  34. }
  35. if(contor==0)
  36. {
  37. cout<<"NU EXISTA";
  38. }
  39. else
  40. {
  41. cout<<maxim<<" "<<apare;
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement