#include <stdio.h>
int main()
{
int n = 0;
int b = 1;
int sum = 0;
for (n = 1; n <= 5; n++)
{
b = b * n;
sum = sum + b;
}
printf("sum=%d", sum);
return 0;
}
c语言 计算 1到5连续阶乘的和
于 2022-12-01 23:15:19 首次发布