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