Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n; cin>>n;
- int v1, v2, v3;
- int i;
- int x;
- v1=-1;
- v2=-1;
- v3=-1;
- for(i=1; i<=n/2; ++i){
- cin>>x;
- if(v2<x){
- v1=v2;
- v2=x;
- }
- }
- cin>>v3;
- if(v2<v3){
- cout<<v2;
- }else
- if(v2==v3 && v1<v2 && v1!=(-1))
- cout<<v1;
- else if(v1==(-1)) cout<<"Nu exista";
Add Comment
Please, Sign In to add comment