#include<stdio.h>
int fun(int x)
{
if(x==1)
return 1;
else
return x*fun(x-1);
}
int main()
{
int n=0;
scanf("%d",&n);
if(n<=0)
printf("the number is wrong");
else
printf("%d!:%d",n,fun(n));
return 0;
}
c语言递归实现阶乘
最新推荐文章于 2023-05-29 11:41:16 发布