![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
1 //以下是本人写的,如有不同关点请联系偶
2
3 int[] array = new int[100];
4 Random r = new Random();
5 ArrayList myList = new ArrayList();
6
7 while (myList.Count < 100)
8 {
9 int temp = r.Next(1, 101);
10 if (!myList.Contains(temp))
11 {
12 myList.Add(temp);
13 }
14 }
15
16 for (int i = 0; i < 100; i++)
17 {
18 array[i] = Convert.ToInt32(myList[i]);
19 }
20
21 for (int i = 0; i < array.Length; i++)
22 {
23 if (i % 10 == 0)
24 {
25 Console.WriteLine();
26 }
27 Console.Write(array[i] + "\t"); ;
28 }
29
30 Console.Read();