#include <stdio.h>
#include <stdlib.h>
int main()
{
int i = 0;
int sum = 0;
int symbol = 1;
int n = 0;
scanf_s("%d", &n);
for (i = 1; i <= n; i++)
{
symbol = symbol*i;
sum = sum + symbol;
}
printf("%d\n", sum);
system("pause");
return 0;
}
转载于:https://blog.51cto.com/10919090/1719858