#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+S5ZWP6aGMRAppbnQgZnVuYyhpbnQgbikgewoJaWYobj09MCl7CgkJcmV0dXJuIC0xOwoJfQoJZWxzZXsKCQlyZXR1cm4gMypmdW5jKG4tMSkgKzU7Cgl9Cn0KaW50IG1haW4odm9pZCkgewoJaW50IG4gPSAzLCBtOwogICAgbSA9IGZ1bmMobik7CiAgICBwcmludGYoIuaVsOWIl2Fu44Gr44Gk44GE44GmLCBuPSVk44Gu44Go44GN44Gu5YCk44GvJWRcbiIsIG4sIG0pOwoJcmV0dXJuIDA7Cn0K