#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int t2 = 1, sum = 0, t1 = 0, i;
printf("请输入需要累加累积次数:\n");
scanf("%d", &t1);
for (i = 1; i <= t1; i++)
{
sum += i;
t2 *= i;
}
printf("%d次累积=%d\t%d次累加=%d\n", t1, t2, t1, sum);
return 0;
}
标签:乘器,int,sum,t2,t1,printf,累加 From: https://blog.51cto.com/u_16073189/6319001