View Code of Problem 45

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

Double click to view unformatted code.


Back to problem 45