经典C程序
#include <stdio.h> void main(){ int test[] = {1,2,3,4}; int x,y,z; for( x=0;x<4;x++){ for( y=0;y<4;y++){ for( z=0;z<4;z++){ if(test[x] != test[y] && test[x] !=test[z] && test[z] !=test[y]) printf("组成的数为:%d%d%d\n",test[x],test[y],test[z]); } } } }
从任意4个数中组成不相同的三位数
生命只有一次。