alex326

Untitled

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