日期:2014-05-20 浏览次数:20636 次
public class Test6 { public static void main(String[] args) { int sum = 0; int[] a = { 1, 2, 3, 4 }; for (int i = 0; i < a.length; i++) { for (int j = 0; j < a.length; j++) { if (a[j] == a[i]) continue; for (int k = 0; k < a.length; k++) { if (a[k] == a[i] || a[k] == a[j]) continue; System.out.println(a[i] + "" + a[j] + "" + a[k]); sum++; } } } System.out.println("共有" + sum + "组数"); } }