这里用到for循环,三重for循环就OK了!具体的就不说了,代码很简单。
#include <stdio.h>
int main()
{
int a,b,c;
for(a=1;a<5;a++) //判断百位
{
for(b=1;b<5;b++) //判断十位
{
for(c=1;c<5;c++) //判断个位
{
if(a!=b&&a!=c&&b!=c)
printf("%d, %d, %d\n",a,b,c);
}
}
}
}