View Code of Problem 45

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[25][25] = { },b[25][25] = { };
	cin>>n;
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++)
			cin>>a[i][j];
	}
	
	
	
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++){
			b[j][i]= a[i][j];
		}
	}
	
	for(int i = 0;i<n;i++){
		for(int j = 0;j<n;j++){
			cout<<a[i][j];
			if(j!=n-1)cout<<" ";
		}
			
		cout<<endl;
	}
	
	return 0;
} 

Double click to view unformatted code.


Back to problem 45