fork download
  1. #include <stdio.h>
  2. int func(int n){
  3. int i,a=4;
  4. for(i=1;i<=n;i++){
  5. a=-3*a+1;
  6. }
  7. return a;
  8. }
  9.  
  10. int main(void) {
  11. int n=5;
  12. printf("値は%d",func(n));
  13. return 0;
  14. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
値は-911