mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1902.cpp
This commit is contained in:
parent
63352a4d26
commit
4a90b5a044
39
QUSTOJ/1902.cpp
Normal file
39
QUSTOJ/1902.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include <iostream>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
|
||||
inline void test()
|
||||
{
|
||||
int n,m;
|
||||
cin>>n>>m;
|
||||
int** a=new int*[n];
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
a[i]=new int[m];
|
||||
for(int j=0;j<m;j++)
|
||||
{
|
||||
cin>>a[i][j];
|
||||
}
|
||||
}
|
||||
for(int j=0;j<m;j++)
|
||||
{
|
||||
for(int i=0;i<n-1;i++)
|
||||
{
|
||||
cout<<a[i][j]<<" ";
|
||||
}
|
||||
cout<<a[n-1][j]<<endl;
|
||||
}
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
delete[] a[i];
|
||||
}
|
||||
delete[] a;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
while(n--) test();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user