fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int x=3,n=0;
  6. do
  7. {
  8. x=2*x-1;
  9. n=n+1;
  10. }
  11. while(x<=1000);
  12. printf("値:%d %d番目",x,n);
  13.  
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
値:1025 9番目