标题:帮我看个程序,花括号位置不同得出的结果完全不一样
取消只看楼主
xk398457183
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2012-6-5
结帖率:0
已结贴  问题点数:10 回复次数:1 
帮我看个程序,花括号位置不同得出的结果完全不一样
#include<stdio.h>                                              #include<stdio.h>
void main()                                                    void main()
{                                                           {
    int a[4][4],b[4][4],i,j;                                   int a[4][4],b[4][4],i,j;
    printf("input 16 number");                                 printf("input 16 number");
    for(i=0;i<4;i++)                                           for(i=0;i<4;i++)
    for(j=0;j<4;j++)                                           for(j=0;j<4;j++)
        {                                                   {
            scanf("%d",&a[i][j]);                             scanf("%d",&a[i][j]);
            b[3-j][i]=a[i][j];                                 b[3-j][i]=a[i][j];
        }                                                   }
        printf("array\n");                                   printf("array\n");
        for(i=0;i<4;i++)                                     for(i=0;i<4;i++)
                                                             for(j=0;j<4;j++)
        {                    就是把此处的花括号移到下方去了                     
                    for(j=0;j<4;j++)                                 {
            printf("%6d",b[i][j]);                                printf("%6d",b[i][j]);
            printf("\n");                                         printf("\n");
            
        }                                                     }
}                                                            }
搜索更多相关主题的帖子: void 位置 include number 
2012-06-06 16:44
xk398457183
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2012-6-5
得分:0 
经过5楼的讲解,懂了点
2012-06-06 17:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-370942-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.115933 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved