View Code of Problem 45

#include<bits/stdc++.h>
using namespace std;
int main(){
	int N;
	scanf("%d",&N);
	int num[N][N];
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<N;j++){
			scanf("%d",&num[i][j]);	
		}			
	}
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<N;j++)
		{
			if(j<N-1){//行 
				printf("%d ",num[j][i]);
			}else{
				printf("%d\n",num[j][i]);
			}
		}
	}
	return 0;	
}

Double click to view unformatted code.


Back to problem 45