View Code of Problem 45

#include <stdio.h>
#include <string.h>

int main(int argc, char** argv) {
	int nums[20][20];
	int n;
	scanf("%d", &n);
	for(int i = 0;i < n; i ++) {
		for(int j = 0; j < n; j ++) {
			scanf("%d", &nums[i][j]);
		}
	}
	
	for(int i = 0;i < n; i ++) {
		for(int j = 0; j < n; j ++) {
			printf("%d", nums[j][i]);
			if(j < n) printf(" ");
		}
		printf("\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 45