再求助
不知道为什么两个结果不一样??????内层{}的意义是什么#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";
}