Create 1449.cpp

This commit is contained in:
KiritoTRw 2016-05-01 18:40:10 +08:00
parent f14091a0ff
commit 79c75b2f4d

28
QUSTOJ/1449.cpp Normal file
View File

@ -0,0 +1,28 @@
#include <stdio.h>
int func(int n)
{
switch(n)
{
case 1:
return 0;
case 2:
return 1;
case 3:
return 2;
case 4:
return 9;
case 5:
return 44;
default:
return (n-1)*(func(n-1)*func(n-2));
}
}
int main()
{
int inc;
while(scanf("%d",&inc)==1)
{
printf("%d\n",func(inc));
}
return 0;
}