View Code of Problem 45

#include "stdio.h"
#include "string.h"

void main()
{
	int n;
	int i,j;
	int a[100][100],b[100][100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			scanf("%d",&a[i][j]);
			b[j][i]=a[i][j];
		}
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			printf("%d ",b[i][j]);
		}
		printf("\n");
	}	
}

Double click to view unformatted code.


Back to problem 45