文件名称:xuhanshu
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:920byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
利用虚函数手段,按照3种不同的计算方法来求出Fibonacci数列的第n项(的具体项值)并输出。具体地说,可通过在基类baseCla及其派生类fib1Cla、fib2Cla和fib3Cla中说明如下的同一个虚函数“virtual double fib(int n) ”,来实现求Fibonacci数列第n项值并返回的3种不同求解方法。例如,可设计并使用已经在第4和第5章的练习中所实现的求解方法:简单变量“数据平移”法、使用数组的实现法以及使用递归函数的实现法。-The use of virtual function means, in accordance with three kinds of different methods of calculation to find Fibonacci series, the first n items (specific items of value) and the output. Specifically, through the base class baseCla its derived classes fib1Cla, fib2Cla and fib3Cla described in the following virtual function with a " virtual double fib (int n) " , to achieve the first n order to Fibonacci sequence item value and return 3 different solutions are given. For example, can be designed and has been used in section 4 and Chapter 5 of the exercise achieved by solving method: simple variable " data translation" method, using an array implementation of law and the implementation method to use recursive functions.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
3.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.