#include<stdio.h>
int main()
{
int a = 0;
int n = 0;
int ret = 1;
scanf("%d", &n);
for (a = 1; a <= n; a++)
{
ret = ret * a;
}
printf("%d\n", ret);
return 0;
}
C语言求n的阶乘
最新推荐文章于 2024-08-22 17:27:46 发布
#include<stdio.h>
int main()
{
int a = 0;
int n = 0;
int ret = 1;
scanf("%d", &n);
for (a = 1; a <= n; a++)
{
ret = ret * a;
}
printf("%d\n", ret);
return 0;
}