Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a,b,max_num,min_num,counter = 0;
- cin>>a;
- for(int i=1;i<=a;i++)
- {
- cin>>b;
- if(i == 1)
- {
- max_num = b;
- min_num = b;
- }
- if(i > 1)
- {
- if(b < min_num)
- {
- min_num = b;
- counter++;
- }
- if(b > max_num)
- {
- max_num = b;
- counter++;
- }
- }
- }
- cout<<counter<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement