文件名称:shiyan15
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 856kb
- 下载次数:
- 0次
- 提 供 者:
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
编写具有如下函数原型的递归与非递归两种函数equ,负责判断数组a与b的前n个元素值是否按下标对应完全相同,是则返回true,否则返回false。并编制主函数对它们进行调用,以验证其正确性。
bool equ(int a[], int b[], int n)
提示:递归函数中可按如下方式来分解并处理问题,先判断最后一个元素是否相同,不同则返false;相同则看n是否等于1,是则返回true,否则进行递归调用(传去实参a、b与 n-1,去判断前n-1个元素的相等性),并返回递归调用的结果(与前n-1个元素的是否相等性相同)。
-Prepared with the following function prototype recursive and non-recursive function of two equ, is responsible for judging the array a and b elements of the former n value corresponds to the same standard press, is the return to true, otherwise return false. And the preparation of the main function to call them to verify its correctness. bool equ (int a [], int b [], int n) Tip: recursive function as follows to decomposition and to address the problem, first determine the last element of the same, different then return false is the same whether or not to see n equal to 1, is the return to true, otherwise, to carry out recursive calls (Chuan to real parameter a, b and n-1, to judge the former n-1 elements of the same sex), and return the results of recursive calls (with the previous n-1 elements of the same whether or not the same).
bool equ(int a[], int b[], int n)
提示:递归函数中可按如下方式来分解并处理问题,先判断最后一个元素是否相同,不同则返false;相同则看n是否等于1,是则返回true,否则进行递归调用(传去实参a、b与 n-1,去判断前n-1个元素的相等性),并返回递归调用的结果(与前n-1个元素的是否相等性相同)。
-Prepared with the following function prototype recursive and non-recursive function of two equ, is responsible for judging the array a and b elements of the former n value corresponds to the same standard press, is the return to true, otherwise return false. And the preparation of the main function to call them to verify its correctness. bool equ (int a [], int b [], int n) Tip: recursive function as follows to decomposition and to address the problem, first determine the last element of the same, different then return false is the same whether or not to see n equal to 1, is the return to true, otherwise, to carry out recursive calls (Chuan to real parameter a, b and n-1, to judge the former n-1 elements of the same sex), and return the results of recursive calls (with the previous n-1 elements of the same whether or not the same).
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shiyan15
........\Debug
........\select.cpp
........\select.dsp
........\select.dsw
........\select.ncb
........\select.opt
........\select.plg
........\shiyan15.dsp
........\shiyan15.dsw
........\shiyan15.ncb
........\shiyan15.opt
........\Debug
........\select.cpp
........\select.dsp
........\select.dsw
........\select.ncb
........\select.opt
........\select.plg
........\shiyan15.dsp
........\shiyan15.dsw
........\shiyan15.ncb
........\shiyan15.opt