这个是2的10000次方
#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
int main(int argc, char *argv[])
{
double log2 = 0.30102999566398119;
int n, digits;
cin>>n;
digits = (int)(n*log2+1)/4+2;
int *num = new int[digits];
memset(num, 0, sizeof(int) * digits);
int p, q, r=1;
p = n%16;
q = n>>4;
num[0] = 1;
num[0] <<= p;
num[1] = num[0]/10000;
num[0] %= 10000;
for(int i=0, g; i<q; ++i)
{
g=0;
for(int j=0; j<r; ++j)
{
num[j] <<= 16;
num[j] += g;
g = num[j]/10000;
num[j] %= 10000;
}
while(g)
{
num[r++]=g%10000;
g/=10000;
}
}
for( ; !num[r]; --r) ;
printf("%d", num[r--]);
if(r>0)
for(r; r>=0; --r)
printf("%04d", num[r]);
delete []num;
system("PAUSE");
return 0;
}
不知道谁写的