#include <stdio.h>
//フィボナッチ数列
int rec(int n){
if(n==1){
return 1;
}
else if(n==2){
return 1;
}
else {
return rec(n-1)+rec(n-2);
}
}
int main(void) {
int n = 10;
for(int i=1;i<=n;i++){
printf("フィボナッチ数列の第%d項は%d\n", i
, rec
(i
)); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8v44OV44Kj44Oc44OK44OD44OB5pWw5YiXCmludCByZWMoaW50IG4pewoJaWYobj09MSl7CgkJcmV0dXJuIDE7Cgl9CgllbHNlIGlmKG49PTIpewoJCXJldHVybiAxOwoJfQogICAgZWxzZSB7CiAgICAJcmV0dXJuIHJlYyhuLTEpK3JlYyhuLTIpOwogICAgfQp9CgppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgbiA9IDEwOwogICAgICAgIGZvcihpbnQgaT0xO2k8PW47aSsrKXsKICAgICAgICBwcmludGYoIuODleOCo+ODnOODiuODg+ODgeaVsOWIl+OBruesrCVk6aCF44GvJWRcbiIsIGksIHJlYyhpKSk7CiAgICAgICAgfQoJcmV0dXJuIDA7Cn0KCg==