#28219: CPP AC 1ms,76kb


c121796577@gmail.com (941115 Lego)

學校 : 不指定學校
編號 : 167085
來源 : []
最後登入時間 :
2021-09-17 11:04:38
a015. 矩陣的翻轉 | From: [203.72.61.162] | 發表日期 : 2021-11-19 10:59

#include <stdio.h>

int row = 0, col = 0 , matrix[100][100];

int main()
{
    while (scanf(" %d %d", &row, &col) == 2)
    {
        for (int i = 0; i < row; i++)
        {
            for (int j = 0; j < col; j++)
                scanf(" %d", &matrix[j][i]);
        }
        for (int i = 0; i < col; i++)
        {
            for (int j = 0; j < row; j++)
                printf("%d ", matrix[i][j]);
            putchar('\n');
        }
    }
    return 0;
}
 
ZeroJudge Forum