fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,maz=-1,ans=0;
  7. while(scanf("%d",&n)!=EOF)
  8. {
  9. if(n>=maz)
  10. {
  11. ans++;
  12. maz=n;
  13. }
  14. }
  15. printf("%d",ans);
  16. return 0;
  17. }
Success #stdin #stdout 0s 15240KB
stdin
3
2
5
1
5
9
3
stdout
4