打表水过:
#include<iostream> using namespace std; int n; long long a[20] = {0,2,7,5,30,169,441,1872,7632,1740,93313,459901,1358657,2504881,0}; int main() { while(cin>>n && n!=0){ cout<<a[n]<<endl; } return 0; }
2023-10-21 23:30:46
打表水过:
#include<iostream> using namespace std; int n; long long a[20] = {0,2,7,5,30,169,441,1872,7632,1740,93313,459901,1358657,2504881,0}; int main() { while(cin>>n && n!=0){ cout<<a[n]<<endl; } return 0; }