kissinger @ 2017-11-01 20:58:21
有几个wa
#include <iostream>
#include <cmath>
using namespace std;
const int MaxN=510;
unsigned int a[MaxN]= {8};
int len=1;
void mul(int);
int main()
{
int p;
cin >> p;
cout << int(p/log2(10)+1) << endl;
p-=3;
for(int i=1; i<=p/20; i++)
mul(20);
mul(p%20);
a[0]--;
for(int i=499;i>=0;i--)
{
cout << a[i];
if(i%50==0) cout << endl;
}
return 0;
}
void mul(int n)
{
int i;
for(i=0; i<501; i++)
{
a[i]=a[i]<<n;
}
for(i=0; i<501; i++)
if(a[i]>10)
{
a[i+1]+=(a[i]/10);
a[i]%=10;
}
}