试题与答案

请编写一个函数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/2019/0315/3097b8ae0fcd5c617690ed3cac2ab6ac.html

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

参考答案:解析:1935年,南京政府宣布,以四大银行发行的钞票为法币。今后所有完粮纳税、公私款收付,一律使用法币,废除了过去多种银两、银元、纸币并行流通的现象。并规定所有白银都要在限期内到银行兑换成法...

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