来个大佬救救孩子

P1009 [NOIP1998 普及组] 阶乘之和

ruanjingqi @ 2022-11-07 20:14:16

#include<iostream>
using namespace std;
int main(){
    long long n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        long long factor=factor*i;
        for(int j=1;j<=i;j++) 
            factor=j*i;
        ans+=factor;
    }
    cout<<ans<<endl;
    return 0;
}

by Gunpowder_OI @ 2022-11-07 20:17:25

要开高精


by ruanjingqi @ 2022-11-08 11:37:50

@Gunpowder_OI ...乘法高?


by Gunpowder_OI @ 2022-11-08 12:28:45

@ruanjingqi 乘法加法都开qwq


|