fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int getBall(string s){
  5. char c;
  6. int i = s.size()-1;
  7. c = s[s.size()-1];
  8. int x = 0;
  9. int p = 1;
  10. while(c>='0' && c<='9'){
  11. x+=(c-'0')*p;
  12. p*=10;
  13. c = s[--i];
  14. }
  15. return x;
  16. }
  17. int main(){
  18. string s;
  19. getline(cin, s);
  20. int i = 0;
  21. long long sum = 0;
  22. while(i!=800){
  23. ++i;
  24. getline(cin, s);
  25. //if(getBall(s)>=75) sum++;
  26. sum+=getBall(s);
  27. }
  28. cout<<sum/800<<endl;
  29. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
0