#20540: 自己測是對的:) 求提示


twm0970420996@gmail.com (小胖胖胖)


#include <iostream>

using namespace std;

int main(){
int row ,col;
cin >> row >> col;
int matrix[row][col];
for(int i = 0 ; i < row ; i++){
for(int j = 0 ; j < col ; j++){
cin >> matrix[i][j];
}
}
for(int i = 0 ; i < col ; i++){
for(int j = 0 ; j < row ; j++){
cout << matrix[j][i] << " ";
}if(i != col-1)
cout << endl ;
}
return 0;
}

 

#20545: Re:自己測是對的:) 求提示


anandrewboy70900 (ShowTsai)


1.重複輸入

2.不用那個if




#20546: Re:自己測是對的:) 求提示


twm0970420996@gmail.com (小胖胖胖)


1.重複輸入

2.不用那個if

Thank you!