玩转矩阵的C小加

题目http://115.159.40.116/problem_show.php?pid=4873

#include<stdio.h>
int main()
{
    int t;
    int a[3][3],b[3][3];
    scanf("%d",&t);
    while(t--)
    {
        int i,j;
        for(i=0; i<3; i++)
        {
            for(j=0; j<3; j++)
            {
                scanf("%d",&a[i][j]);
                b[j][i]=a[i][j];//利用两重数组把a的行和列互换,并存到数组b中
            }
        }
        for(i=0; i<3; i++)
        {
            for(j=0; j<3; j++)
            {
                printf("%d ",b[i][j]);//利用双重循环把数组b输出;
            }
            printf(" ");//控制换行;这个不错
        }
        printf(" ");
    }
    return 0;
}

"No regrets."
原文地址:https://www.cnblogs.com/zxy160/p/7215196.html