fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n=4;
  5. int a,b=2,c=1;
  6.  
  7. for(int i=3; i<=n;i++){
  8.  
  9. a=-6*b+9*c;
  10. c=b;
  11. b=a;
  12.  
  13. }
  14. printf("%dのとき%d",n,n);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
4のとき4