private static void sum(int[] nums) { Random rnd = new Random(); for(int i=nums.Length-1; i>=0; i--) { int a= rnd.Next(i + 1); //Console.WriteLine(a); int tmpe=nums[a]; nums[a] = nums[i]; nums[i]= tmpe; //Console.WriteLine(nums.Length); } for (int j = 0; j < nums.Length; j++) { Console.WriteLine(nums[j]); } }
标签:Random,Console,nums,int,洗牌,Length,随机,WriteLine From: https://www.cnblogs.com/lin-07/p/17527412.html