标签:
1 #include <stdio.h> 2 #define MAX 31 3 int a[MAX]; 4 int main() { 5 int n; 6 a[0] = 1; 7 a[2] = 3; 8 for(int i = 4; i< MAX; i = i+2) 9 a[i] = 4*a[i-2] - a[i-4]; 10 while(scanf("%d",&n)==1&&n!=-1) 11 printf("%d\n",a[n]); 12 return 0; 13 }
标签:
原文地址:http://www.cnblogs.com/travelller/p/4418378.html