UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#167266#1001. 数组转置struct1000ms1200kbC++254b2023-01-01 22:30:462023-01-01 22:30:47

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	int c[a][b];
	for(int i=0;i<a;i++)for(int j=0;j<b;j++)cin>>c[i][j];
	for(int i=0;i<b;i++){for(int j=0;j<a;j++){
		cout<<c[j][i]<<' ';
	}cout<<endl;}
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 33
Accepted
time: 0ms
memory: 1200kb

input:

3 3
2 4 9
0 7 4
2 8 5

output:

2 0 2 
4 7 8 
9 4 5 

result:

ok 3 lines

Test #2:

score: 33
Accepted
time: 0ms
memory: 1200kb

input:

5 6
71 39 95 89 91 29
98 87 3 2 82 51
87 44 95 20 85 66
12 47 90 15 96 28
72 17 77 54 18 37



output:

71 98 87 12 72 
39 87 44 47 17 
95 3 95 90 77 
89 2 20 15 54 
91 82 85 96 18 
29 51 66 28 37 

result:

ok 6 lines

Test #3:

score: 33
Accepted
time: 0ms
memory: 1196kb

input:

9 11
7 73 68 44 2 66 80 69 73 38 31
36 40 62 13 50 43 46 9 43 40 48
51 4 26 15 1 24 77 49 61 81 22
9...

output:

7 36 51 94 78 55 72 35 66 
73 40 4 5 50 77 58 14 89 
68 62 26 33 47 46 90 89 92 
44 13 15 39 55 51 1...

result:

ok 11 lines