HDU/2045-i/main.c
Saturneric 0525ffad24 Add.
2020-09-01 00:48:58 +08:00

15 lines
258 B
C

#include<stdio.h>
int main(){
int m;
double ans[51];
ans[1] = 3;
ans[2] = 6;
ans[3] = 6;
for(int i=4;i<51;i++){
ans[i] = ans[i-1] + 2*ans[i-2];
}
while(scanf("%d", &m)!=EOF){
printf("%.0lf\n", ans[m]);
}
}