fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n=4;
  5. int a,b,c;
  6. b=2;
  7. c=1;
  8. for(int i=2;i<n;i++){
  9. a=-6*b-9*c;
  10. c=b;
  11. b=a;
  12. }
  13. printf("数列a%dの値は%d\n",n,a);
  14. // your code goes here
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
数列a4の値は108