View Code of Problem 45

#include<cstdio>
#include<iostream>
using namespace std;
int a[22][22];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            scanf("%d",&a[i][j]);
    for(int j=0;j<n;j++)
    {
        for(int i=0;i<n;i++)
        {
            printf("%d%c",a[i][j],i==n-1?'\n':' ');
        }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 45