//主函数中输入n,调用递归函数计算n!
//并输出
#include <stdio.h>
int Rec(int i);
int main()
{
int n;
scanf("%d",&n);
printf("%d的阶乘:%d",n,Rec(n));
return 0;
}
int Rec(int i)
{
if(i<=1)
{
return 1;
}
return i*Rec(i-1);
}
11-01
1558
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-18
851
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-03
2677
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)