骨牌铺方格
Time Limit: 1000MS Memory Limit: 32768KB
Problem Description
在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图:

Input
输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2×n (0< n<=50)。
Output
对于每个测试实例,请输出铺放方案的总数,每个实例的输出占一行。
Example Input
1
3
2
Example Output
1
3
2
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, i;
long long int temp, t1, t2;
while(~scanf("%d", &n))
{
t1 = 1;
t2 = 2;
if(n ==1) {printf("1\n"); continue;}
if(n ==2) {printf("2\n"); continue;}
for(i=3;i<=n;i++)
{
temp = t1 +t2;
t1 = t2;
t2 = temp;
}
printf("%lld\n", temp);
}
return 0;
}