Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151760 王培臻 二维数组的最大值与最小值 C++ Accepted 1 MS 272 KB 345 2026-04-18 15:26:27

Tests(2/2):


Code:

#include<bits/stdc++.h> using namespace std; int main() { long long s,a[11][11],d,f; cin>>s; for(int i=1;i<=s;i++){ for(int j=1;j<=s;j++){ cin>>a[i][j]; } } d=f=a[1][1]; for(int i=1;i<=s;i++){ for(int j=1;j<=s;j++){ if(a[i][j]>d)d=a[i][j]; if(a[i][j]<f)f=a[i][j]; } } cout<<f<<" "<<d; return 0; }