25 lines
522 B
C++
25 lines
522 B
C++
#include <iostream>
|
|
#include <stdio.h>
|
|
using namespace std;
|
|
int main() {
|
|
int t;
|
|
cin>>t;
|
|
while(t-->0) {
|
|
int n,m;
|
|
cin>>n>>m;
|
|
int arr1[n][m],arr2[m][n];
|
|
for(int i=0;i<n;i++) {
|
|
for(int j=0;j<m;j++) {
|
|
cin>>arr1[i][j];
|
|
}
|
|
}
|
|
for(int i = 0; i < m; i++)
|
|
{
|
|
for(int j = 0; j < n; j++){
|
|
printf("%d", arr1[j][i]);
|
|
printf(" ");
|
|
}
|
|
printf("\n");
|
|
}
|
|
}
|
|
} |