Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("bac.txt");
- int main()
- {
- int x,y,i,n,v[256],maxim=0,ok=0;
- f>>n;
- for(i=1;i<=n;i++)
- f>>v[i];
- f>>x>>y;
- for(i=1;i<=n;i++)
- {
- if(v[i]>=x && v[i]<=y)
- if(maxim<v[i])
- maxim=v[i];
- ok=1;
- }
- if(ok==0)
- cout<<"NU EXISTA";
- else
- cout<<maxim;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement