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