Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n,a;
- short x[1005];
- int main()
- {
- cin>>n;
- for(int i=1;i<=n;i++)
- {
- cin>>a;
- if(a>99&&a<=999)
- x[a]=1;
- }
- int nr=0;
- int i=999,a,b;
- while(i>99&&nr<2)
- {
- if(!x[i])
- {
- nr++;
- if(nr==1)
- a=i;
- if(nr==2)
- b=i;
- }
- i--;
- }
- if(nr==2)
- {
- if(a>b)
- swap(a,b);
- cout<<a<<' '<<b;
- }
- else
- cout<<"NU EXISTA";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement