View Code of Problem 45

#include<stdio.h>

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

Double click to view unformatted code.


Back to problem 45