fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5.  
  6. int a=1;
  7. int sum=0;
  8.  
  9. while(sum<=1000)
  10. {
  11. sum=sum+a;
  12. a=a+1;
  13. }
  14. printf("初めて1000を超えるのは%dを足した直後である\n",a);
  15.  
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
初めて1000を超えるのは46を足した直後である