fork(1) download
  1. #include <stdio.h>
  2. int main() {
  3. int a=1,b=0;
  4. do
  5. {
  6. a=a+b;
  7. b=b+1;
  8. }
  9. while(a>=1000);
  10. printf("%dを足して初めて1000を超えます。\n", b);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
1を足して初めて1000を超えます。