View Code of Problem 45

#include<stdio.h>
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#include<vector>
#include<cstdbool>
using namespace std;


int main()
{
	int p[21][21];
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int y = 0; y < n; y++) {
			cin >> p[i][y];
		}
	}
	for (int i = 0; i < n; i++) {
		for (int y = 0; y < n; y++) {
			if(y!=n-1){
			cout << p[y][i]<<" ";
			}
			else {
				cout << p[y][i] << endl;
			}
		}
		
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 45