View Code of Problem 45

#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<string>
using namespace std;
int main()
{
	int n;
	int a[20][20];
	scanf("%d", &n);
	int w = n;
	while (w--) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				scanf("%d", &a[i][j]);
				//printf("%d %d",i,j);
			}
				
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				printf("%d ", a[j][i]);
				
			}
			printf("\n");
		}
	}

}

Double click to view unformatted code.


Back to problem 45