#define _CRT_SECURE_NO_WARNINGS 1
//防止visual studio2013以上版本scanf报错,vc6.0环境可忽略
#include<stdio.h>
int main()
{
int i, j,n;
int sum = 0;
int team=1;
printf("请输入n的值:");
scanf("%d", &n);
if (n <= 0)
{
printf("n为正整数,请重新输入\n");
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
team = team * j;
sum = team + sum;
}
}
printf("该式的值为:%d",sum);
return 0;
}