fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5.  
  6. int a=3,n=0;
  7.  
  8. do
  9. {
  10. a=2*a-1;
  11. n=n+1;
  12. }
  13. while(a<=10000);
  14. printf("この値は%dで最初から%d番目です\n",a,n);
  15.  
  16.  
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
この値は16385で最初から13番目です