fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=1, n=0;
  5. do
  6. {
  7. a=a*2;
  8. n = n + 1;
  9. }
  10. while( a<=10000 );
  11. printf("2の %d 乗で初めて10000を超えます\n", n);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5280KB
stdin
21
stdout
2の 14 乗で初めて10000を超えます