Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93771 | 王思颜 | 二维数组的最大值与最小值 | C++ | Wrong Answer | 1 MS | 272 KB | 388 | 2024-10-19 11:09:34 |
#include<bits/stdc++.h> using namespace std; int main(){ int b,x,y; cin>>b; int a[b][b]; for (int i = 0;i <= b;i++){ for (int j = 0;j <= b;j++){ cin>>a[i][j]; } } for (int k = 0;k <= b;k++){ for (int n = 0;n <= b;n++){ if (a[k][n] > x){ x = a[k][n]; } if (a[k][n] < y){ y = a[k][n]; } } } cout<<x<<" "<<y; return 0; }
------Input------
3 1 2 3 4 5 6 7 8 9
------Answer-----
1 9
------Your output-----
4196062 -754285856