fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=0,n=3;
  5. scanf("%d",&n);
  6. while( n <= 10000 )
  7. {
  8. n = 2*n-1;
  9. a = a + 1;
  10. }
  11. printf("10000を超えるのは%d番目です。 \n", a);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
10000を超えるのは13番目です。