fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5.  
  6. int n=1,x=1;
  7.  
  8. do{
  9. x=2*x+1;
  10. n++;
  11. }while(x<=1000);
  12. printf("n=%dの時x=%dで1000を超える\n",n,x);
  13.  
  14.  
  15.  
  16.  
  17. // your code goes here
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
n=10の時x=1023で1000を超える