应用题
1. 使用VC++6.0打开
考生文件夹下的源程序文件2.cpp。完成fun()函数,其功能是:求出M行N列二维数组每行元素中的最小值,并计算它们的和。和通过形参传回主函数并输出。
注意:不能修改程序的其他部分,只能修改fun()函数。
试题程序: #include <iostream.h>
#define M 2
#define N 4
void fun(int a[M][N],int *sum)
{
}
void main()
{
int x[M][N]={7,6,5,2,4,2,8,3};
int s;
fun(x,&s);
cout<<s<<endl;
return;
}