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