Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
108231 胡海峰老师 二维数组的最大值与最小值 C++ Accepted 0 MS 268 KB 348 2025-01-19 21:00:03

Tests(2/2):


Code:

#include <iostream> using namespace std; int a[11][11]; int main(){ int m,n,d,min=99999,max=0; cin>>m ; for(int i=0;i<m;i++) for(int j=0;j<m;j++) { cin>>d; if(d>max) max =d; if(d<min) min =d; } cout<< min<<" "<<max; return 0; } /*Input 3 1 2 3 4 5 6 7 8 9 Output 1 9 */