#include <stdio.h>
int main()
{
int b=0,s=0,g=0; //拆分成百位b,十位s,个位g三个变量
int count=0; //用来计数
for(b=1; b<5; b++) //可以是1,2,3,4这四个数字
{
for(s=1; s<5; s++)
{
for(g=1; g<5; g++)
{
if(b!=s && b!=g && s!=g) //条件里有说无重复的数字
{
printf("%d %d %d\n",b,s,g);
count++; //没打出来一次符合条件的数count加1
}
}
}
}
printf("count=%d\n",count); //打印出总共有多少个
return 0;
}
运输结果:
