denghuolanshan_1004 @ 2023-02-14 17:52:22
#include <bits/stdc++.h>
using namespace std;
int main(){
int a;
int b=1;
cin>>a;
int c=0;
for (int i=1;i<=a;i++){
for (int j=1;j<=i;j++){
b*=j;
}
c+=b;
b=1;
}
cout<<b<<endl;
return 0;
}
by denghuolanshan_1004 @ 2023-02-15 18:00:05
我以前用python3写(数据限制
PS:学废了谢谢各位
by tianyuxuan @ 2023-02-24 16:10:55
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
long long ans=0,a;
cin>>n;
for(int i=1;i<=n;i++){
a=1;
for(int j=1;j<=i;j++){
a*=j;
}
ans+=a;
}
cout<<ans;
return 0;
}