Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int i,n,v[1001],x,x1,ok;
- int main()
- {
- cin>>n;
- for (i=1;i<=n;i++)
- {
- cin>>x;
- if (x<1000)
- v[x]=1;
- }
- x=0;
- x1=0; ok=0;
- for (i=999;i>=100 && !ok;i--)
- {
- if (v[i]==0 && !x)
- x=i;
- else
- if (v[i]==0 && x)
- {
- ok=1;
- x1=i;
- }
- }
- if (!x || !x1)
- cout<<"NU EXISTA";
- else
- cout<<x1<<" "<<x;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement