文件名称:shuzupaixu
介绍说明--下载内容来自于网络,使用问题请自行百度
题目描述
a)实现一个函数。函数的参数有2个,分别是数组
名(数组起始地址),数组大小(即数组元素个数
)。函数返回值为void。函数功能是将数组中有意
义的元素按降序排列。
b)实现一个函数。函数的参数有3个,分别是数组
名(数组起始地址,要求数组元素按降序排列),
数组大小(即数组元素个数),和待插入的元素值
。函数返回值为void。函数功能是将待插入的元素
插入数组中,并维持降序排列。例如:将元素4插
入数组{8,7,5,2,1,0, 0}后,数组变为{8,7
,5,4,2,1,0}
c)在主函数中定义数组,元素个数为100,首先读
入5个整数作为数组元素初始值(剩余元素初始值为
0),并调用第一个函数,对数组进行降序排列 然后
读入1个整数作为数组新增元素,调用第二个函数将
其插入数组并输出。
输入格式
6个整数,前5个为数组元素初始值,第6个为新增元
素值
输出格式
数组前6项-Title Descr iption a) implement a function. Function has two parameters, namely the name of the array (the starting address of the array), array size (i.e., number of array elements). Function returns void. Function function is meaningful elements in the array are arranged in descending order. b) implement a function. Function has three parameters, namely the name of the array (the starting address of the array, the array elements required in descending order), the array size (i.e., number of array elements), and the value of the element to be inserted. Function returns void. Function function is to be inserted into the array element into, and maintained in descending order. For example: the element 4 is inserted into the array {8,7,5,2,1,0, 0}, the array becomes {8,7, 5,4,2,1,0} c) defined in the main array function , the number of elements is 100, reads the first array element 5 as an initial value of an integer (the remaining elements initial value is 0), and a call to the first func
a)实现一个函数。函数的参数有2个,分别是数组
名(数组起始地址),数组大小(即数组元素个数
)。函数返回值为void。函数功能是将数组中有意
义的元素按降序排列。
b)实现一个函数。函数的参数有3个,分别是数组
名(数组起始地址,要求数组元素按降序排列),
数组大小(即数组元素个数),和待插入的元素值
。函数返回值为void。函数功能是将待插入的元素
插入数组中,并维持降序排列。例如:将元素4插
入数组{8,7,5,2,1,0, 0}后,数组变为{8,7
,5,4,2,1,0}
c)在主函数中定义数组,元素个数为100,首先读
入5个整数作为数组元素初始值(剩余元素初始值为
0),并调用第一个函数,对数组进行降序排列 然后
读入1个整数作为数组新增元素,调用第二个函数将
其插入数组并输出。
输入格式
6个整数,前5个为数组元素初始值,第6个为新增元
素值
输出格式
数组前6项-Title Descr iption a) implement a function. Function has two parameters, namely the name of the array (the starting address of the array), array size (i.e., number of array elements). Function returns void. Function function is meaningful elements in the array are arranged in descending order. b) implement a function. Function has three parameters, namely the name of the array (the starting address of the array, the array elements required in descending order), the array size (i.e., number of array elements), and the value of the element to be inserted. Function returns void. Function function is to be inserted into the array element into, and maintained in descending order. For example: the element 4 is inserted into the array {8,7,5,2,1,0, 0}, the array becomes {8,7, 5,4,2,1,0} c) defined in the main array function , the number of elements is 100, reads the first array element 5 as an initial value of an integer (the remaining elements initial value is 0), and a call to the first func
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shuzupaixu.cpp
shuzupaixu.exe
shuzupaixu.o
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.