如果你是要用递归计算阶乘,这样就可以了:
#include<stdio.h>
long factorial(int number)
{
if(number<=1)
return 1;
else
return(number*factorial(number-1));
}
void main()
{
int n;
printf("input a munber:");
scanf("%d",&n);
printf("%d!=%ld",n,factorial(n));
}