fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main() {
  5. int n ,x , tmp , C_high_score = 0 , C_low_score = 0 , high_score , low_score ;
  6. cin >> n >> tmp;
  7. high_score = tmp;
  8. low_score = tmp;
  9. for (int i = 1 ; i < n ; i ++){
  10. cin >> x;
  11. if (x > high_score){
  12. high_score = x;
  13. C_high_score+=1;
  14. }
  15. if (x < low_score){
  16. low_score = x;
  17. C_low_score+=1;
  18. }
  19. }
  20. cout << C_high_score << " " << C_low_score;
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
0 0