#45765: c++ AC


yp11351170@yphs.tp.edu.tw (702-37謝博宇)

學校 : 臺北市私立延平高級中學
編號 : 301675
來源 : [203.72.178.1]
最後登入時間 :
2025-04-10 11:38:10
a015. 矩陣的翻轉 | From: [203.72.178.1] | 發表日期 : 2025-04-10 11:34

#include <iostream>
using namespace std;

int main()
{
    int matrix[100][100];
    int row,col;
    while (cin >> row >> col){
        for (int i=0;i<row;++i){
            for (int j=0;j<col;++j){
                cin >> matrix[i][j];
            }
        }
    
        for (int i=0;i<col;++i){
            for (int j=0;j<row;++j){
                cout << matrix[j][i]; 
                if (j != row - 1){
                    cout << " ";
                }
            }
            cout << endl;
        }
    }
    return 0;
}

 
ZeroJudge Forum