fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a = 3, times = 0;
  6. do{
  7. a = a * 2 - 1;
  8. times += 1;
  9. }while(a <= 10000);
  10.  
  11. printf("この数列が10000を超えるのは%d番目で値は%d", times, a);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
この数列が10000を超えるのは13番目で値は16385