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. while( a<=10000 );
  11. printf("2の %d 番目で %d となり、初めて10000を超えます\n", n,a);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
2の 13 番目で 16385 となり、初めて10000を超えます