fork download
  1. #include <stdio.h>
  2. int hoge(int n){
  3. if(n==0)
  4. return 0;
  5. if(n==1)
  6. return 1;
  7. int i;
  8. int x[n+1];
  9. x[0]=0;
  10. x[1]=1;
  11. for(i=2;i<=n;i++)
  12. {
  13. x[i]=4*x[i-1]+3*x[i-2];
  14. }
  15. return x[n];
  16. }
  17. int main(){
  18. printf("%d",hoge(3));
  19. return 0;
  20. }
  21.  
  22.  
  23.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
19