计算1×2×3×4……n=sum
输入n的值计算sum
#include<stdio.h>
int main()
{
int i, sum = 1, n;
scanf_s("%d", &n);
for (i = 1; i < n + 1; i++)
sum *= i;
printf("%d", sum);
return 0;
}
运行结果:
标签:return,语言,int,sum,++,006,main
来源: https://blog.csdn.net/m0_62731177/article/details/121569874