Advertisement
alex326

Untitled

Jan 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,mx=0,c=0,ok=0,o=0,x;
  6. cin>>n;
  7. while (n!=0){
  8. x=n;
  9. o=0;
  10. while (n){
  11. o=o*10+(n%10);
  12. n/=10;
  13. }
  14. if (x==o){
  15. ok=1;
  16. if (x>mx){
  17. mx=x;
  18. c=0;
  19. }
  20. }
  21. if (mx==x)
  22. c++;
  23. cin>>n;
  24. }
  25. if (ok==0)
  26. cout<<"NU EXISTA";
  27. else
  28. cout<<mx<<" "<<c;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement