踏上星辰


私信TA

用户名:xingchen123

访问量:2117

签 名:

等  级
排  名 6310
经  验 1372
参赛次数 0
文章发表 12
年  龄 0
在职情况 学生
学  校 湖南科技大学
专  业

  自我简介:

解题思路:
感觉有不必要的步骤,希望有大佬能指出来
注意事项:

参考代码:

#include <stdio.h>

int main(void)

{

    int three[3][3];

    int t;              //作为中间变量

    for(int j=0;j<=2;j++)

    {

        for(int k=0;k<=2;k++)

            scanf("%d",&three[j][k]);

    }

   int j=0,k=0;

    for(int j=0;j<=2;j++)

    {

         if(j==1&k==0)

        {


        t=three[j][k];

        three[j][k]=three[k][j];

        three[k][j]=t;

        }

        if(j==2&k==0)

            break;

        else

            {

        for(int k=0;k<=2;k++)

        {

            t=three[j][k];

            three[j][k]=three[k][j];

            three[k][j]=t;

        }

            }


    }

    //输出

    j=0,k=0;

    for(int j=0;j<=2;j++)

    {

        for(int k=0;k<=2;k++)

        {

            printf("%d ",three[j][k]);

            if(k==2) printf("\n");

        }

    }


        return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区