英文翻译

Write a function named copy_arr(source, target, length) to copy the
contents of an array-of-double to another array.
Write another function named sort(array, length) to sort the array passed
by parameter in descending order.
Write a main() function that initializes the array-of-double and then call
copy_arr() to make the copy, and show all the element-values of the copied
array . then call the sort() function , and show all the element-values of the
sorted array.
Here is an example main():
double source[5] = {1.1, 2.2, 3.3., 4.4, 5.5};
double target [5];
copy_arr(source, target, 5);
display_array(target);
sort(target);
display_array(source);//for comparing
display_array(target);

写一个函数命名copy_arr(源,目标,长度)复制数组双到另一个数组的内容。写一个函数名(数组排序,长度)的阵列的参数依次通过排序。写一个函数来初始化main()双然后调用copy_arr()使复制数组,和显示的所有复制数组元素的值。然后调用sort()功能,并显示排序后的数组中的所有元素的值。下面是一个例子main():双源[ 5 ] = { 1.1,2.2,3.3,4.4,5.5。};双目标[ 5 ];copy_arr(源,目标,5);display_array(目标);排序(目标);display_array(源);//比较display_array(目标);
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答