1 solutions

  • 0
    @ 2023-2-8 15:00:41
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a[110][110],r[110];
    	int n, m, ma, x;
    	cin >> n >> m;
    	for(int i = 1; i <= n; i++){
    		ma = 0;//每行年龄的最大值
    		for(int j = 1; j <= m; j++){
    			cin >>a[i][j];
    			ma = max(ma,a[i][j]);
    		} 
    		r[i] = ma;//存入结果数组 
    	}
    	for(int i = 1; i <= n; i++){
    		cout << r[i] << endl;
    	} 
    	return 0;
    }
    
    
    • 1

    Information

    ID
    1333
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    10
    Tags
    # Submissions
    3
    Accepted
    2
    Uploaded By