fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int C, N, S, V;
  6. C = 0;
  7. S = 0;
  8. cin >> V;
  9. while (C < V) {
  10. cin >> N;
  11. S = S + N;
  12. C = C + 1;
  13. };
  14. cout << S;
  15. return 0;
  16. }
Success #stdin #stdout 0s 4280KB
stdin
3
7
5
2
stdout
14