1 #include <stdio.h> 2 int main(int argc, const char *argv[]) 3 { 4 int g,s,b; 5 int count=0;//计数器 6 for(g=1;g<5;g++) 7 { 8 for(s=1;s<5;s++) 9 { 10 for(b=1;b<5;b++) 11 { 12 if(g!=s && g!=b && s!=b) 13 printf("%d%d%d\n",g,s,b); 14 count++; 15 } 16 } 17 } 18 printf("有%d个三位数",count); 19 return 0; 20 }
标签:数字,int,三位数,互不,多少,重复 From: https://www.cnblogs.com/xj123/p/17128436.html