#55524: c++ 解法 只接用座標反轉下去解即可


61247091s@gapps.ntnu.edu.tw (wei)


#include <bits/stdc++.h>
using namespace std;

int main(){
    int r,c;
    while(cin>>r>>c){
    int a[105][105];
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++)cin>>a[i][j];
    }
    for(int i=0;i<c;i++){
        for(int j=0;j<r;j++)cout<<a[j][i]<<" ";cout<<endl;
    }}


    return 0;
}