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