Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 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>9)
  16. x=x/10;
  17.  
  18. if(x<=cifMin)
  19. if(copie>=nrMax)
  20. {
  21. cifMin = x;
  22. nrMax = copie;
  23. }
  24.  
  25. n=n-1;
  26. }
  27. cout<<nrMax;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement