标题:再求助
取消只看楼主
lljojo501
Rank: 1
等 级:新手上路
帖 子:6
专家分:3
注 册:2012-9-26
结帖率:66.67%
 问题点数:0 回复次数:1 
再求助
不知道为什么两个结果不一样??????内层{}的意义是什么

#include<stdio.h>
#include<iostream.h>
#include<math.h>
main( )
{   
    char i,j,k;
    void show(char );
    for (i='X';i<='Z';i++)
        for (j='X';j<='Z'; j++)
            if (i!=j)
                for (k='X';k<='Z';k++)
                    if (i!=k&&j!=k)
                        if( i!='X'&&k!='X'&&k!='Z')
                        {printf("A--%c\tB--%c\tC--%c\n",i,j,k);
                        cout<<"A-";
                        show(i);
                        cout<<"B-";
                        show(j);
                        cout<<"C-";
                        show(k);}



        
}
void show(char p)   
{
if(p=='X')
cout<<"zhangsan\n";
if(p=='Y')
cout<<"lisi\n";
if(p=='Z')
cout<<"wangwu\n";
}


第二个#include<stdio.h>
#include<iostream.h>
#include<math.h>
main( )
{   
    char i,j,k;
    void show(char );
    for (i='X';i<='Z';i++)
        for (j='X';j<='Z'; j++)
            if (i!=j)
                for (k='X';k<='Z';k++)
                    if (i!=k&&j!=k)
                        if( i!='X'&&k!='X'&&k!='Z')
                        printf("A--%c\tB--%c\tC--%c\n",i,j,k);
                        cout<<"A-";
                        show(i);
                        cout<<"B-";
                        show(j);
                        cout<<"C-";
                        show(k);



        
}
void show(char p)   
{
if(p=='X')
cout<<"zhangsan\n";
if(p=='Y')
cout<<"lisi\n";
if(p=='Z')
cout<<"wangwu\n";
}
搜索更多相关主题的帖子: include void 
2012-09-27 23:16
lljojo501
Rank: 1
等 级:新手上路
帖 子:6
专家分:3
注 册:2012-9-26
得分:0 
难理解啊!
2012-09-28 18:51



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




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

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