1.有i,j,k三位
2.对各位枚举且i!=j!=k;
3.输出满足条件的情况
include<iostream>
#include<cmath>
using namespace std;
int main(){
int flag=0;
for(int i=1;i<=4;i++){
for(int j=1;j<=4;j++){
for(int k=1;k<=4;k++){
if(i!=j&&j!=k&&i!=k){
printf("%d%d%d ",i,j,k);
flag++;
if(flag%8==0){printf("\n");}
}
}
}
}
printf("有%d种组合",flag);
return 0;
}
标签:d%,int,30,flag,位数,&&,printf,day From: https://www.cnblogs.com/drz1145141919810/p/17407817.html