fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, x;
  6. while(cin >> n){
  7. x+=n;
  8. }
  9. cout << x;
  10. }
Success #stdin #stdout 0.01s 5524KB
stdin
1
2
3
stdout
6