标签:
#include <iostream>
#include<string.h>
using namespace std;
const int MAX = 51;
__int64 arr[MAX];
int main()
{
int n = 0;
memset(arr,0,sizeof(arr));
arr[1] = 1;
arr[2] = 2;
for(int i = 3;i < MAX;i++){
arr[i] = arr[i-1] + arr[i-2];
}
while(cin >> n){
cout << arr[n] << endl;
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/2016zhanggang/p/5517772.html