50分求助😭

P1009 [NOIP1998 普及组] 阶乘之和

jfish616 @ 2024-12-08 14:41:53


#include<stdio.h>
int main()
{

    int n;  
    int sum=0;
    scanf("%d",&n);
    int a;
    int b=n;
    for(int p=0;p<n;p++)
    {       
        a=1;    
        for (int i=b;i>0;i--)
        {
            a=a*i;          
        }
    sum+=a;
    b--;                    
    }   
    printf("%d",sum);   
    return 0;   
}

by whr24syy119 @ 2024-12-09 20:45:03

用高精。爆int了,开unsigned long long也没用


|