資源簡介
信息學(xué)奧賽一本通C++版配套光盤文件(第五版)文件,包含課程PPT課后習(xí)題與測試數(shù)據(jù)哦。謝謝
代碼片段和文件信息
#include
#include
using?namespace?std;
int?a[100000]niyxy[100000];
int?main()
{
cin>>n;
a[0]=1;
a[1]=1;
for?(y=1;y<=n;y++)?
{
memset(xy0sizeof(xy));
????xy[0]=a[0];
????for?(i=1;i<=a[0];i++)
????{
??xy[i]+=a[i]*y;
??xy[i+1]=xy[i]/10;
??xy[i]%=10;
}
????while?(xy[xy[0]+1]>0)?
{
xy[xy[0]+2]=xy[xy[0]+1]/10;
xy[xy[0]+1]%=10;
xy[0]++;
????}
????for?(i=1;i<=xy[0];i++)?a[i]=xy[i];
????a[0]=xy[0];
}
for?(i=a[0];i>=1;i--)?cout< cout< return?0;
}
評(píng)論
共有 條評(píng)論