View Code of Problem 45

#include<stdio.h>
#include <string.h>
int main(){
    int N;
    int a[100][100]={0,0};
    int 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[j][i]=a[i][j];
			}
		}
	for(i=0;i<N;i++){
    		for(j=0;j<N;j++){
    			if(j%N==0)
    			printf("\n");
    			printf("%d ",b[i][j]);
			}
		}
	printf("\n");
	return 0;
}

Double click to view unformatted code.


Back to problem 45