HDU 1443 Joseph

打表水过:

#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;  
}

 

posted @ 2014-01-15 15:29  forever97  阅读(98)  评论(0编辑  收藏  举报