![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5iZ0MTMxYTMiJWY3M2NyADO3ETZ0MWN0cjNmVjNzYzNi9CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
1.
#include <iostream>
2.
3. using namespace std;
4.
5. //斐波那契
6.
7. void main()
8. {
9. int a[13]={1,1};
10.
11. for(int n=2;n<13;n++) //作為月份
12.
13. {
14. a[n] = a[n-1]+a[n-2];//第N月兔子對數 等于 前兩個月之和
15.
16. cout<<a[n]<<endl;
17.
18. }
19.
20.
21.
22.
23. }