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