fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a_0=3;
  6. int a_n=0;
  7. int n=0;
  8. do
  9. {
  10. a_n=2*a_0-1;
  11. a_0=a_n;
  12. n=n+1;
  13. }while(a_n<=10000);
  14. printf("10000を超えたときの値は%d\n",a_n);
  15. printf("それは%d番目\n",n);
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
10000を超えたときの値は16385
それは13番目