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[21][21];
	scanf("%d", &n);
	int w = n;
	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]);
			if (j != n - 1) {
				printf(" ");
			}
				
		}
			//if (w != 1) {
			printf("\n");
			//}
	}

}

Double click to view unformatted code.


Back to problem 45