fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a=3,n=0;
  6. printf("%d回目、%d\n",n,a);
  7. do
  8. {
  9. a=2*a-1;
  10. n=n+1;
  11. printf("%d回目、%d\n",n,a);
  12. }
  13. while(a<=10000);
  14. printf("%d回目で初めて10000を超える。\n",n);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5268KB
stdin
Standard input is empty
stdout
0回目、3
1回目、5
2回目、9
3回目、17
4回目、33
5回目、65
6回目、129
7回目、257
8回目、513
9回目、1025
10回目、2049
11回目、4097
12回目、8193
13回目、16385
13回目で初めて10000を超える。