fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int *liczba=new int [100];
  6.  
  7. int i=0;
  8. int main()
  9. {
  10.  
  11. int suma=0;
  12. cin>>liczba[i];
  13. while(liczba[i]>=-100&&liczba[i]<=100)
  14. {
  15.  
  16. suma+=liczba[i];
  17. i++;
  18. cout<<suma<<endl;
  19. cin>>liczba[i];
  20. }
  21.  
  22. }
Success #stdin #stdout 0s 4180KB
stdin
6
8
-3
stdout
6
14
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11