题目:
分析:斐波那契数列问题
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int month;
while(cin>>month)
{
//这个月的兔子数=(上个月的老兔子+上个月的新兔子)所有兔子生,而上个月的老兔子就是上上个月的新兔子
int first=1;
int second=1;
int sum=1;
while(month>2)
{
sum=first+second;
first=second;
second=sum;
month--;
}
cout<<sum<<endl;
}
return 0;
}