View Code of Problem 45

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
const int maxn=100;
int arr[maxn][maxn];
int b[maxn][maxn];
int main()
{
	int n=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
		{
			scanf("%d",&arr[i][j]);
			b[j][i]=arr[i][j];
		}
	for(int i=0;i<n;i++)
	{
		printf("%d",b[i][0]);
		for(int j=1;j<n;j++)
			printf(" %d",b[i][j]);
		printf("\n");
	}
	//system("pause");


}

Double click to view unformatted code.


Back to problem 45