Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int x ,y;
- while(cin>>x>>y){
- int a[x][y];
- int b[y][x];
- for(int i=0;i<x;i++){
- for(int j=0;j<y;j++)
- cin>>a[i][j];
- }
- for(int i=0;i<y;i++){
- for(int j=0;j<x;j++)
- b[i][j]=a[j][i];
- }
- for(int i=0;i<y;i++){
- for(int j=0;j<x;j++){
- cout<<b[i][j];
- if(j<x-1)
- cout<<" ";
- }
- cout<<endl;
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment