View Code of Problem 45

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;

int main() {
	int t;
	int num[21][21];
	int i,j;
	scanf("%d",&t);
	getchar();
	for(i=0; i<t; i++) {
		for(j=0; j<t; j++) {
			scanf("%d",&num[i][j]);
			getchar();
		}
	}
	for(i=0; i<t; i++) {
		for(j=0; j<t; j++) {
			if(j==0) {
				printf("%d",num[j][i]);
			} else {
				printf(" %d",num[j][i]);
			}
		}
		printf("\n");
	}
}

Double click to view unformatted code.


Back to problem 45