标签:style blog class code java ext
public void RandSort(int[] _num) { Random rd = new Random(); int temp = 0, tempNum = 0; for (int i = 0; i < _num.Length-1; i++) { temp = rd.Next(i, _num.Length); tempNum=_num[i]; _num[i] = _num[temp]; _num[temp] = tempNum; Thread.Sleep(20);//注意:引入命名空间:System.Threading; } string str = null; foreach (int item in _num) { str += item.ToString() + ","; } MessageBox.Show(str); }
把这个50个数的顺序打乱,分别显示出来??怎么做???,布布扣,bubuko.com
标签:style blog class code java ext
原文地址:http://www.cnblogs.com/zxbzl/p/3713691.html