#include <stdio.h>
//階乗計算を再帰を用いて行う
int factorial(int n){
if (n == 1){
return 1;
}
else{
return n*factorial(n-1);
}
}
int main(void) {
int n = 4;
printf("1から%dまでの積は%d\n", n
, factorial
(n
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8v6ZqO5LmX6KiI566X44KS5YaN5biw44KS55So44GE44Gm6KGM44GGCmludCBmYWN0b3JpYWwoaW50IG4pewogICAgaWYgKG4gPT0gMSl7CnJldHVybiAxOwogICAgfQogICAgZWxzZXsKICAgIAlyZXR1cm4gbipmYWN0b3JpYWwobi0xKTsKCiAgICB9Cn0KCmludCBtYWluKHZvaWQpIHsKICAgIGludCBuID0gNDsKICAgIHByaW50ZigiMeOBi+OCiSVk44G+44Gn44Gu56mN44GvJWRcbiIsIG4sIGZhY3RvcmlhbChuKSk7CglyZXR1cm4gMDsKfQo=