题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int i,j,k;
printf("\n");
for(i=1;i<5;++i)
{
for(j=1;j<5;j++)
{
for(k=1;k<5;k++)
{
if(i==j && i == k && j==k)
{
continue;
}else
{
printf("%d%d%d\n",i,j,k);
}
}
}
}
return 0;
}