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