fork download
  1. #include <stdio.h>
  2. int main() {
  3. int a,b;
  4. a=1;
  5. b=0;
  6.  
  7. do{
  8. a=a+1;
  9. a=2*a+1;
  10. if(a>=100&&a<=10000){
  11. b++; }
  12. }while(a<=10000);
  13. printf("100以上から10000以下となるのは%d\nである",b);
  14.  
  15.  
  16.  
  17. // こちらに作成
  18. return 0;
  19.  
  20. }
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
100以上から10000以下となるのは7
である