杭电acm2045

a[2] = 6;

#include <stdio.h>

int main() {
	
	int n, i;
	__int64 a[50]={3, 6, 6};
	
	for(i=3; i<50; i++)
		a[i] = a[i-1] + a[i-2] * 2;
	
	while(~scanf("%d", &n)) {
		printf("%I64d\n", a[n-1]);
	}
	
	return 0;
}


posted @ 2015-03-13 13:51  StevenLuke  阅读(129)  评论(0编辑  收藏  举报