第十二周项目3(4)

来源:互联网 发布:什么叫java参数传递 编辑:程序博客网 时间:2024/05/01 23:51
/*  *Copyright (c) 2014, 烟台大学计算机学院  *All rights reserved.  *文件名称:week12-project3(4).cpp  *作者:管毓云  *完成日期:2014年 11 月 18 日  *版本号:v1.0  *  *问题描述:  *输入描述:  *程序输出: /*  *Copyright (c) 2014, 烟台大学计算机学院  *All rights reserved.  *文件名称:week12-project3(2).cpp  *作者:管毓云  *完成日期:2014年 11 月 18 日  *版本号: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){int f;if(n==1||n==2)    f=1;else f=fib(n-1)+fib(n-2) ;return f;}

0 0