View Code of Problem 45

#include <stdio.h>
#include <string.h>

int main()
{
    int N;
    scanf("%d",&N);
    int a[N][N];
    int i,j;
    for(i=0;i<N;i++)  //行
    {
            for(j=0;j<N;j++)
        {
            scanf("%d",&a[i][j]);
        }
    }
     
      for(i=0;i<N;i++)  
    {
            for(j=0;j<N;j++)
        {
            printf("%d",a[j][i]);
            if(j!=N-1)
            printf(" ");
        }
    printf("\n");
    }

   
  	return 0;
  }

Double click to view unformatted code.


Back to problem 45