該樓層疑似違規已被系統折疊?隱藏此樓查看此樓
#include ??
#include ??
using ??namespace ??std;
int ??main(int ??argc, ??char ??*argv[])
{
 ? 
 ? ?long ??i,j,?c,len,temp?=?0;
 ? ?int ??n ??= ??95123;
 ? ?long ?*a=new ??long[4 ??* ??n]; ? ? ? ? ? ??//動態分配空間
 ? ?a[0]=1; ??len=1;
 ? ?for(i=0; ??i<12; ??i++)
 ? ?{
 ? ? ? ?c=0;
 ? ? ? ?for(j=?0; ?j
 ? ? ? ?{
 ? ? ? ? ? ?temp=a[j]*?n+c;
 ? ? ? ? ? ?c=?temp/10000;
 ? ? ? ? ? ?a[j]=temp%10000;
 ? ? ? ?}
 ? ? ? 
 ? ? ? ?while(c>0) ? ? ? ? ? ? ? ??//處理進位
 ? ? ? ?{
 ? ? ? ? ? ?len?=?len?+1;
 ? ? ? ? ? ?a[len-1]=c;
 ? ? ? ? ? ?c/=?100000;
 ? ? ? ? ? ?a[len?-?1]%=10000;
 ? ? ? ?}
 ? ?}
 ? ?printf(?"%ld?", ??a[len-1]);
 ? ?for(i=len-2; ??i>=0;?i--) ? ? ??//逆序輸出
 ? ? ? ?printf(?"%04ld?", ??a[i]); ? ? ? ? ? ? ? 
 ? 
 ? ?delete ??a; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??//釋放空間
 ? 
 ? ?system(?"PAUSE?");
 ? ?return ??0;
}