Your task is to caculate N! .
Input
For each test case : Line 1 : An integer N.(0 <= N <= 10) Process to the end of file.
Output
For each test case : Line 1 : Output the answer of N!.
Sample Input
3
Sample Output
6
運用遞歸
int main(void)
{
double func(double);
int n;
while(scanf("%d", &n) == 1)
{
printf("%.0f\n", func(n));
}
}
double func(double m)
{
if(m == 1 || m == 0)
{
return 1;
}
else
{
return m * func(m - 1);
}
}