fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a[50],i;//多めに要素を確保
  5. a[0]=2; a[1]=6;
  6. for(i=2;i<10;i++)
  7. a[i]=a[i-1]+a[i-2]*2-3;
  8.  
  9. for(i=0;i<10;i++)
  10. printf("%d ", a[i]);
  11. printf("\n");
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
2 6 7 16 27 56 107 216 427 856