Advertisement
Guest User

Ora info 26 februarie

a guest
Feb 26th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int v[1000];
  7. int main()
  8. {
  9. int n,i,d,a,b,x;
  10. cin>>n;
  11. for(i=1;i<=n;i++)
  12. {
  13. cin>>x;
  14. if(x>99&&x<1000)
  15. {
  16. v[x]++;
  17. }
  18. }
  19. a=0;
  20. b=0;
  21. for(i=999;i>99;i--)
  22. {
  23. if(v[i]==0)
  24. {
  25. if(b==0)
  26. {
  27. b=i;
  28. }
  29. else
  30. {
  31. a=i;
  32. break;
  33. }
  34. }
  35. }
  36. if(a!=0)
  37. {
  38. cout<<a<<" "<<b;
  39. }
  40. else
  41. {
  42. cout<<"NU EXISTA";
  43. }
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement