http://acm.hdu.edu.cn/showproblem.php?pid=2085
这也是一个简单的的递推。
a[i][0] = 3*a[i-1][0]+2*a[i-1][1];
a[i][1] = a[i-1][0]+a[i-1][1];
#include <stdio.h>
int main()
{
__int64 a[][];
int i,j,k;
a[][] = ;
a[][] = ;
a[][] = ;
a[][] = ;
for (i = ;i<=;i++)
{
a[i][] = *a[i-][]+*a[i-][];
a[i][] = a[i-][]+a[i-][];
}
while (scanf("%d",&j)!=EOF&&j!=-)
printf("%I64d, %I64d\n",a[j][],a[j][]);
return ;
}