fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=3, n=0;
  5. while(a<10000)
  6. {
  7. a = 2*a - 1;
  8. n += 1;
  9. }
  10. printf("数列が10000を超えるとき、a_(%d)=%dである",n,a);
  11.  
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
数列が10000を超えるとき、a_(13)=16385である