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