标签:
Description
Input
Output
Sample Input
Sample Output
#include<iostream> using namespace std; long long a[25]; int main() { int n; while(cin>>n) { a[2]=1; a[3]=2; for(int i=3;i<=n;i++) { a[i]=(i-1)*(a[i-1]+a[i-2]); } cout<<a[n]<<endl; } }
标签:
原文地址:http://www.cnblogs.com/hfc-xx/p/4743302.html