Advertisement
Guest User

pt prostu de bunta

a guest
Jan 27th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. ifstream fin ("nrlipsa.in");
  6.  
  7. ofstream fout ("nrlipsa.out");
  8.  
  9. int v[1000];
  10.  
  11. int main ()
  12.  
  13. {
  14.  
  15. int i,x,a=0,b=0;
  16.  
  17. while (fin>>x)
  18.  
  19. {
  20.  
  21. if (x<1000&&x>99)
  22.  
  23. v[x]++;
  24.  
  25. }
  26.  
  27. for (i=999;i>=100;i--)
  28.  
  29. if (v[i]==0)
  30.  
  31. if (b==0)
  32.  
  33. b=i;
  34.  
  35. else
  36.  
  37. {
  38.  
  39. a=i;
  40.  
  41. break;
  42.  
  43. }
  44.  
  45. if (a==0||b==0)
  46.  
  47. fout<<"NU"<<'\n';
  48.  
  49. else
  50.  
  51. fout<<b<<" "<<a<<'\n';
  52.  
  53. return 0;
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement