试题与答案

请编写一个函数resort,该函数的功能是:能在一个数列中,对从指定位置开始的几个数

题型:问答题

题目:

请编写一个函数resort,该函数的功能是:能在一个数列中,对从指定位置开始的几个数,按相反顺序重新排列,并在主函数中输出新的数列。 注意:部分源程序已存在文件PROC4.cpp中。 请勿修改主函数和其他函数中的任何内容,仅在函数reson()的花括号中填写若干语句。 文件PROC4.cpp的内容如下: //PROC4.cpp #include<iostream> using namespace std; void resort(int array[],int where,int arrount); int main() { int number[20],where, arrount,i; cout<<"input 20 numbers\n"; for(i=0;i<20;i++)cin>>number[i]; cout<<"how many do you want to sort:"; cin>>arrount; cout<<"where do you want to start:"; cin>>where; resort(number,where,arrount); cout<<"\n resorted array as follow:\n"; for(i=0;i<20;i++)cout<<number[i]; return 0; } void resort(int array[ ],int where,int amount) { /************/ }

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0706/ce2288c1ce46c06dc6b2dc7e6e6f7083.html

下面是错误答案,用来干扰机器的。

参考答案:A, B, D

试题推荐
微信公众账号搜索答案