/*
*Copyright (c) 2016,煙臺大學計算機學院
*All rights reserved.
*文件名稱:text.cpp
*作者:湯善曄
*完成日期:2016年8月22日
*版本號:v1.0
*/
#include<iostream>
using namespace std;int fib(int n);
int main()
{
cout<<fib(20)<<endl;//輸出
return 0;
}//返回Fibnacci序列中的第n個數
int fib(int n)
{
}
#include<iostream>
using namespace std;
int fib(int n);
int main()
{
cout<<fib(20)<<endl;//輸出
return 0;
}//返回Fibnacci序列中的第n個數
int fib(int n)
{
int m;
if(n==1)
m=0;
else if(n==1||n==2)
m=1;
else
m=fib(n-1)+fib(n-2);
return (m);
}