我想把产生的随机数副给一个数组做比较就可以了

解决方案 »

  1.   

    int[] num ={0,1,2,3,4,5,6,7,8};
            int n = num.length;
            int[] result = new int[n];
            for(int i=0;i<result.length;i++)
            {
                int r = (int)(Math.random()*n);
                result[i] = num[r];  
                num[r] = num[n-1];  //move the last element to the location r.
                n--;
                System.out.print(result[i]+" "); //print
            }
    今天刚学到的
    学习ing