标签:scanf printf main std include war 输入 amp pause
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()//求阶乘的和
{
int i, n;
int sum = 0;
int tmp = 1;
printf("请输入数字:");
scanf("%d", &n);
for (i = 1; i <= n; i++){
tmp *= i;
sum += tmp;
}
printf("sum = %d\n", sum);
system("pause");
return 0;
}
标签:scanf printf main std include war 输入 amp pause
原文地址:https://www.cnblogs.com/Leafbud/p/12559255.html