#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <Windows.h>
#include <string.h>
int main()
{
printf("请输入一个数,计算它的阶乘");
long long int a=1,n=1,m,sum=0;
scanf("%lld", &m);
while (n <= m)
{
a = a * n;
n++;
sum = sum + a;
}
printf("阶乘是:%lld\n", a);
printf("阶乘之和是:%lld\n", sum);
return 0;
}