Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {int x;
- int mn=1e9;
- int mx=-1e9;
- int p=0;
- int k=0;
- ifstream fin("bac.txt");
- while(fin>>x)
- {p++;
- if(x>mx || x<mn)
- {
- if(x>mx)
- {
- mx=x;
- }
- if(x<mn)
- {
- mn=x;
- }
- }
- else
- {
- if(mx!=x)
- {
- k++;
- cout<<p<<" ";
- }
- }
- }
- if(!k)
- {
- cout<<"nu exista!";
- }
- fin.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement