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. max = now;
  11. i = 1;
  12. if (now = max) {
  13. i = i + 1;}}
  14. cin >> now;}
  15. cout << i;
  16.  
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 15240KB
stdin
1 7 9 0
stdout
2