一道推公式的水题 0.0
#include<iostream>
using namespace std;
const int maxn=1001;
int main()
{
int f[maxn];
f[1]=0,f[2]=2,f[3]=2;
for(int i=4;i<maxn;i++)
f[i]=(f[i-1]%10000+(2*f[i-2])%10000)%10000;
int n;
while(cin>>n){
if(n==0) break;
cout<<f[n]<<endl;
}
return 0;
}