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