题目标题: 第39级台阶

    小明刚刚看完电影《第39级台阶》,离开电影院的时候,他数了数礼堂前的台阶数,恰好是39级!

    站在台阶前,他突然又想着一个问题:

    如果我每一步只能迈上1个或2个台阶。先迈左脚,然后左右交替,最后一步是迈右脚,也就是说一共要走偶数步。那么,上完39级台阶,有多少种不同的上法呢?


    请你利用计算机的优势,帮助小明寻找答案。

要求提交的是一个整数。
注意:不要提交解答过程,或其它的辅助说明文字。

#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main()
{
	int f[40][2];
	f[1][0]=1;
	f[1][1]=0;
	f[2][0]=1;
	f[2][1]=1;
	for(int i=3;i<=39;i++)
	{
		f[i][0]=f[i-1][1]+f[i-2][1];
		f[i][1]=f[i-1][0]+f[i-2][0];
	}
	cout<<f[39][1]<<endl;
    return 0;
	
}