问题 6354 --求最大值

6354: 求最大值★★

时间限制: 1 Sec  内存限制: 128 MB
提交: 426  解决: 314
[提交][状态][命题人:]

题目描述

阅读并完善以下代码,使代码通过键盘输入3*4矩阵,并编写函数求解矩阵元素最大值

#include <iostream>
using namespace std;
//---------------------------
int main(){ 
	int max(int [][4]) ;
	_______(1)______;
	for(int i=0; i<3; ++i)
		for(int j=0; j<4; ++j)
			cin>>a[i][j]; 
	cout<<"the max is "<<_____(2)______<<endl;
	return 0;
}
int max(int array[][4]){ 
	_____(3)_______;
	for(int i=0;i<3;++i)
		for(int j=0;j<4;++j)
			if(______(4)_____) max=array[i][j];
    return max;
}
//================================

输入

输出

样例输入
Copy
1 2 3 4
5 6 7 8
9 7 5 3
样例输出
Copy
the max is 9

提示

来源

[提交][状态]