fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. // put your code here
  5. int max, now,i = 0;
  6. cin >> now;
  7. max = now;
  8. while (now != 0) {
  9. if (now > max) {
  10.  
  11. i = 0;
  12. if (now = max) {
  13. i = i + 1;}
  14. now = max;
  15. }
  16. cin >> now;}
  17. cout << i;
  18.  
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 15240KB
stdin
1 7 9 0
stdout
1