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