文件名称:shiyan15
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:9.8kb
-
已下载: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/shiyan15.dsw
shiyan15/shiyan15.ncb
shiyan15/Debug
shiyan15/shiyan15.opt
shiyan15/shiyan15.dsp
shiyan15/select.cpp
shiyan15/select.dsp
shiyan15/select.ncb
shiyan15/select.plg
shiyan15/select.opt
shiyan15/select.dsw
shiyan15
shiyan15/shiyan15.ncb
shiyan15/Debug
shiyan15/shiyan15.opt
shiyan15/shiyan15.dsp
shiyan15/select.cpp
shiyan15/select.dsp
shiyan15/select.ncb
shiyan15/select.plg
shiyan15/select.opt
shiyan15/select.dsw
shiyan15
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.