Haidde @ 2024-02-18 18:50:38
#include<stdio.h>
int main()
{
int n,i,j;
long int s=0,m=1;
scanf("%d",&n);
if(n==1)
printf("1");
else
{
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
m*=j;
s+=m;
}
}
printf("%ld",s);
return 0;
}
by WZWZWZWY @ 2024-02-18 18:53:22
@Haidde 题目说了,要
用高精度计算
by WZWZWZWY @ 2024-02-18 18:55:42
代码本身也有问题
每次循环 m 没有初始化
by yn_ko_86 @ 2024-02-23 10:17:17
@Haidde 高精度