Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("file.in");
- ofstream fout("file.out");
- int main()
- {
- int n,cnt=0;
- double x[1841];
- cin >> n;
- for(int i=1;i<=n;i++)
- cin >> x[i];
- for(int i=2;i<n;i++)
- {
- if(x[n]<=x[1])
- {
- if(x[i]>x[1] || x[i]<x[n])
- cnt++;
- }
- else
- {
- if(x[i]<x[1] || x[i]>x[n])
- cnt++;
- }
- }
- cout << cnt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement