1 条题解

  • 0
    @ 2026-3-9 21:56:01
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n, m;
    	cin >> n >> m;
    	int a[105][105], at[105][105];
    	for(int i = 0;i < n;i++){
    		for(int j = 0;j < m;j++){
    			cin >> a[i][j];
    		}
    	}
    	for(int i = 0;i < m;i++){
    		for(int j = 0;j < n;j++){
    			at[i][j] = a[j][i];
    		}
    	}
    	for(int i = 0;i < m;i++){
    		for(int j = 0;j < n;j++){
    			cout << at[i][j] << " ";
    		}
    		cout << endl;
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    130
    时间
    1000ms
    内存
    256MiB
    难度
    7
    标签
    递交数
    114
    已通过
    28
    上传者