#include "stdafx.h"
#include<stdio.h>
int a(int n)
{
int sum=1;
if (n <= 1)
sum = 1;
else
sum = n*a(n - 1);
return sum;
}
void main()
{
int a(int n);
int n,sum;
printf("please input a number:\n");
scanf("%d", &n);
sum = a(n);
printf("the result is :%d\n", sum);
//此方法为递归
}