fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here 1/n n=1..100 1/n^2
  6. int n,x;
  7. cin>>n;
  8. int s=0;
  9.  
  10. for(int i=0;i<=n;i++){
  11. cin>>x;
  12. if (x>0){
  13. s=s+x;
  14. }
  15.  
  16. }
  17. cout<<s;
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
5
157
175
-193
157
168
4456
stdout
5113