xkm0606 @ 2024-12-02 20:24:39
#include <bits/stdc++.h>
using namespace std;
int main()
{
double a,c=1,d=0;
cin>>a;
for(int i=a;i>0;i--)
{
for(int r=i;r>0;r--)
{
c=c*r;
}
d+=c;
c=1;
}
printf("%.0f",d);
}
50分求调。
by _Sky_Dream_ @ 2024-12-02 20:26:11
@xkm0606
别开double开longlong
by xkm0606 @ 2024-12-03 19:38:36
用longlong分更低了
分数
by sdvfduhufh @ 2024-12-07 12:14:20
@xkm0606@xkm0606用高精
by sdvfduhufh @ 2024-12-07 12:15:09
@sdvfduhufh超long long了
by sdvfduhufh @ 2024-12-07 12:15:52
#include<bits/stdc++.h>
using namespace std;
string add(string& a,string& b)
{
string ans;
int x=0,i=a.size()-1,j=b.size()-1;
while(i>=0||j>=0){
int c1=i>=0? a[i--]-'0':0;
int c2=j>=0? b[j--]-'0':0;
x+=c1+c2;
ans+=x%10+'0';
x/=10;
}
if(x) ans+="1";
reverse(ans.begin(),ans.end());
a=ans;
return ans;
}
string mul(string& a,string &b)
{
if(a=="0"||b=="0") return "0";
int x=0,l1=a.size(),l2=b.size();
string ans(l1+l2-1,'0');
for(int i=l1-1;i>=0;i--)
{
x=0;
for(int j=l2-1;j>=0;j--)
{
int c1=a[i]-'0',c2=b[j]-'0';
x+=c1*c2+ans[i+j]-'0';
ans[i+j]=x%10+'0';
x/=10;
}
if(i) ans[i-1] +=x;
}
if(x) ans=to_string(x)+ans;
return ans;
}
by litianrui0201 @ 2024-12-14 23:07:01
油题