Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
79
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.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,cifMin=9,nrMax=0;
  8. cin>>n;
  9. while(n>0)
  10. {
  11. int x;
  12. cin>>x;
  13. int copie=x;
  14. int inv = 0;
  15. while(x>0)
  16. {
  17. inv = inv*10+(x%10);
  18. x=x/10;
  19. }
  20. x=inv%10;
  21.  
  22. if(x<=cifMin)
  23. if(copie>=nrMax)
  24. {
  25. cifMin = x;
  26. nrMax = copie;
  27. }
  28.  
  29. n=n-1;
  30. }
  31. cout<<nrMax;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement