使用VC6打开考生文件夹下的工程RevProj10。此工程包含一个源程序文件RevMain10.cpp。在该文件中,函数fun的功能是:计算出数组x中的最小值与次最小值,并分别将其与x[0]、x[1]交换。 请改正程序中的错误,使它能得到正确结果。 注意,不要改动主函数,不得删行或增行,也不得更改程序的结构。 源程序文件RevMain10.cpp中的程序清单如下: //RevMain10.cpp #include <iostream> using namespace std; #define N 30 int fun(int *x, int n); int main () { int h[N]={4,7, 6, 5, 1, 7,3, 8,0,2,3}; int i; for (i=0; i<11; i++) cout<<h [i] << " " ; cout <<"/n"; fun(h, 11); for (i=0; i<n; i++) cout<<h [i]<<" "; cout<<’ \n’; return 0; } int fun(int *x, int n) { int i,t; int a1=0, a2=0,min1=32767,min2=32676; /* * * * *FOUND * * * * */ for(i=1;i<n;i++) {if (x [i]<min1){min2=min1;a2=a1;min1=x [i];a1=i;}else if (x [i] <min2){min2=x [i];a2=i;} } /* * * * *FOUND * * * * */ t=x[0];x[a1]=x[0];x[a1]=t; /* * * * *FOUND * * * * */ t=x[1] ;x[a2]=x[1];x[a2]=t; }