Advertisement
catalyn

simulare2015/sIII/pr4

Mar 7th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream f("bac.txt");
  5. int main()
  6. {
  7. int x,y,i,n,v[256],maxim=0,ok=0;
  8. f>>n;
  9. for(i=1;i<=n;i++)
  10. f>>v[i];
  11. f>>x>>y;
  12. for(i=1;i<=n;i++)
  13. {
  14. if(v[i]>=x && v[i]<=y)
  15. if(maxim<v[i])
  16. maxim=v[i];
  17. ok=1;
  18. }
  19. if(ok==0)
  20. cout<<"NU EXISTA";
  21. else
  22. cout<<maxim;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement