使用VC6打开考生文件夹下的工程RevProj8。此工程包含一个源程序文件 RevMain8.cpp。在该文件中,函数resort的功能是:能在一个数列中,对从指定位置开始的几位数,按相反顺序重新排列,并在主函数中输出新的序列。 请改正程序中的错误,使它能得到正确结果。 注意,不要改动main函数,不得删行或增行,也不得更改程序的结构。 源程序文件RevMain8.cpp中的程序清单如下: //RevMain8.cpp #include <instream> using namespace std; void resort(int arr[],int where,int amount); 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<<"\n where do you want to start: "; cin>>where; cout<<"old array as follow:\n"; for (i=0; i<20; i++) cout<<nmuber [i] <<" "; resort (number,where, arrount); cout<<"\n resorted array as follow:\n"; for (i=0; i<20; i++) cout<<number [i] <<" "; cout<<end1; return 0;