fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=3,n=0;
  5. do
  6. {
  7. a=2*a-1;
  8. n=n+1;
  9.  
  10. }
  11. while(a<=10000);
  12. printf("%d回目で%dとなり、10000を超えます。\n",n,a);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
13回目で16385となり、10000を超えます。