#25765: C language 簡易寫法


22207807 (會打Code的貓)

School : 逢甲大學
ID : 156777
IP address : [51.79.156.19]
Last Login :
2021-09-07 13:32:07
a015. 矩陣的翻轉 | From: [42.72.17.218] | Post Date : 2021-06-21 13:26

#include<stdio.h>

#include<stdlib.h>

int main () {

int x,y;

int a[100][100]={0};

while(scanf("%d %d",&x,&y) != EOF) {

for(int i = 0; i < x; i++) {

for(int j = 0; j < y; j++) {

scanf("%d",&a[i][j]);

}

}

for(int i = 0; i < y; i++) {

for(int j = 0; j < x; j++) {

printf("%d ",a[j][i]);

}

printf("\n");

}

}

return 0;

}

 
ZeroJudge Forum