#define _CRT_SECURE_NO_WARNINGS
// ¼øȯÀûÀÎ ÆÑÅ丮¾ó ÇÔ¼ö °è»ê
#include <stdio.h>
int factorial(int n);
int main(void)
{
int x = 0, result;
printf("Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ:");
scanf("%d", &x);
result = factorial(x);
printf("%d!Àº %dÀÔ´Ï´Ù.\n", x, result);
return 0;
}
int factorial(int n)
{
printf("factorial(%d)\n", n);
if (n <= 1) return 1;
else return n * factorial(n - 1);
}