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