#38613: C++


yp11251074@yphs.tp.edu.tw (706-38郭宸宇)

學校 : 臺北市私立延平高級中學
編號 : 246067
來源 : [61.64.2.49]
最後登入時間 :
2024-05-01 23:23:08
a015. 矩陣的翻轉 | From: [1.200.246.184] | 發表日期 : 2023-12-10 12:09

#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;
        }
    }
}

 

 
ZeroJudge Forum