View Code of Problem 45

#include<stdio.h>
#include<math.h>
void main(){
	int n,a[20][20],b[20][20];
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++){
			scanf("%d",&a[i][j]);
			b[j][i]=a[i][j];
		}
	for(int x=0;x<n;x++){
		for(int y=0;y<n;y++){
			printf("%d",b[x][y]);
			if(x+1!=n&&y+1!=n)
				printf(" ");
		}
		printf("\n");
		}
}

Double click to view unformatted code.


Back to problem 45