Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,cifMin=9,nrMax=0;
- cin>>n;
- while(n>0)
- {
- int x;
- cin>>x;
- int copie=x;
- int inv = 0;
- while(x>9)
- x=x/10;
- if(x<=cifMin)
- if(copie>=nrMax)
- {
- cifMin = x;
- nrMax = copie;
- }
- n=n-1;
- }
- cout<<nrMax;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement