fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. signed main()
  5. {
  6. int n,a;
  7. long long sum=0;
  8. while(cin>>n)
  9. {
  10. sum=0;
  11. while(n--)
  12. {
  13. cin>>a;
  14. sum+=a;
  15. }
  16. cout<<sum<<endl;
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5660KB
stdin
Standard input is empty
stdout
Standard output is empty