题目:有1、2、3、4四个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
1 public class lianxi11 { 2 public static void main(String[] args) { 3 int count = 0; 4 for(int x=1; x<5; x++) { 5 for(int y=1; y<5; y++) { 6 for(int z=1; z<5; z++) { 7 if(x != y && y != z && x != z) { 8 count ++; 9 System.out.println(x*100 + y*10 + z ); 10 } 11 } 12 } 13 } 14 System.out.println("共有" + count + "个三位数"); 15 } 16 }
题目:有1、2、3、4四个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
原文:http://www.cnblogs.com/sosolili/p/4970575.html