View Code of Problem 45

#include <iostream>
#include <math.h>
using namespace std;
int main(){
	int N;
	scanf("%d",&N);
	int num[N][N];
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<N;j++)
			scanf("%d",&num[j][i]);
	}
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<N;j++)
		{
			if(j<N-1)
				printf("%d ",num[i][j]);
			else
				printf("%d\n",num[i][j]);
		}
	}
	return 0;
	
}

Double click to view unformatted code.


Back to problem 45