#33665: ans


j812018@nehs.hc.edu.tw (嗨)

學校 : 國立科學工業園區實驗高級中學
編號 : 152750
來源 : [101.10.45.143]
最後登入時間 :
2023-01-19 22:25:33
a015. 矩陣的翻轉 | From: [111.243.24.96] | 發表日期 : 2023-01-19 22:26


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

 

 

 


int main() {
    int a[100][100]={};
    int r,c;
    while(cin>>r>>c){
    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];
              if (j != r - 1){     
                                cout << " ";
                            }
        }
        cout <<endl;
    }
}
    return 0;

 

}

 
ZeroJudge Forum