fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int sum = 0;
  5. while (1) {
  6. int num = -1;
  7. scanf("%d", &num);
  8. if (num >= 0) {
  9. sum += num;
  10. } else {
  11. break;
  12. }
  13. }
  14. }
Success #stdin #stdout 0s 2168KB
stdin
1
2
3

stdout
Standard output is empty