fork download
  1. #include <iostream>
  2. int main()
  3. {
  4. short n, x=0;
  5. while(std::cin >> n)
  6. {
  7. x += n;
  8. std::cout << x << std::endl;
  9. }
  10. return 0;
  11. }
Success #stdin #stdout 0s 3300KB
stdin
1
1
1
1
1
1
1
1
1
1
1
1
1
stdout
1
2
3
4
5
6
7
8
9
10
11
12
13