#include <stdio.h>
//練習問題D
int func(int n){
if(n==0)
return -1;
else
return 3*func(n-1)+5;
}
int main(void) {
int n = 3, m;
m = func(n);
printf("数列anについて, n=%dのときの値は%d\n", n
, m
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8v57e057+S5ZWP6aGMRAppbnQgZnVuYyhpbnQgbil7CiAgICBpZihuPT0wKQogICAgcmV0dXJuIC0xOwogICAgZWxzZQogICAgcmV0dXJuIDMqZnVuYyhuLTEpKzU7CiAgIH0KCmludCBtYWluKHZvaWQpIHsKCWludCBuID0gMywgbTsKICAgIG0gPSBmdW5jKG4pOwogICAgcHJpbnRmKCLmlbDliJdhbuOBq+OBpOOBhOOBpiwgbj0lZOOBruOBqOOBjeOBruWApOOBryVkXG4iLCBuLCBtKTsKCXJldHVybiAwOwp9Cg==