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