fork download
  1. ///SPOJ ZADANIE NR 968 - SUMA///
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int liczba, suma=0;
  8.  
  9. int main()
  10. {
  11. while(cin>>liczba)
  12.  
  13. {
  14. suma=suma+liczba;
  15. cout << suma << endl;
  16. }
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5424KB
stdin
2
stdout
2