fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int quantity,force,count = 0,max = 0;
  6. cin >> quantity;
  7. while (cin >> force)
  8. {
  9. if (force > max)
  10. {
  11. max = force;
  12. count = 1;
  13. }
  14. else if (force == max) count++;
  15. }
  16. cout << count;
  17. return 0;
  18. }
Success #stdin #stdout 0s 4376KB
stdin
6
3 2 1 3 1 
stdout
2