MarvinWang @ 2021-05-20 21:51:48
#include<iostream>
#include<cmath>
using namespace std;
const long long d=10,md=(long long)pow(10,d),cd=500/d,cy=cd-1;
string x;
long long a[cd];
void write(long long n){
if(n==0)
{
cout<<x;
return;
}
long long q=n;
int p=0,i;
while(n)
{
n/=10;
p++;
}
for(i=0;i<d-p;i++) cout<<0;
cout<<q;
}
int main(){
#ifdef ONLINE_JUDGE
#else
freopen("in.txt","r",stdin);
#endif
int n,i,j,s;
for(i=0;i<d;i++){
x+="0";
}
cin>>n;
a[cy]=1;
cout<<floor(n*0.30102999566)+1<<endl;
for(i=0;i<n;i++){
for(s=0,j=cy;j>0;j--){
a[j]=a[j]*2+s;
s=a[j]/md;
a[j]%=md;
}
a[0]=(a[0]*2+s)%md;
}
a[cy]--;
for(s=i=0;i<cd;i++){
s+=d;
write(a[i]);
if(s==50)
{
s=0;
cout<<endl;
}
}
}
哪里错了?