This commit is contained in:
root 2016-04-10 09:08:47 +08:00
parent 3fc75f01f2
commit 495bb21001

18
NYOJ/912.cpp Normal file
View File

@ -0,0 +1,18 @@
#include <cstdio>
long long px[16];
int main()
{
px[1]=0;
px[2]=1;
px[3]=2;
for(int i=4;i<16;i++)
{
px[i]=(i-1)*(px[i-1]+px[i-2]);
}
int t;
while(scanf("%d",&t)==1)
{
printf("%lld\n",px[t]);
}
return 0;
}