paixu

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0923up
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rd = new Random();
            int [] array=new int[100];
            int count = 0;
            while (count < 100)
            {
                int num = rd.Next(1, 101);
                if (array[num-1] == 0)
                {
                    array[num-1] = num;
                    count++;
                }
            }
            for (int i = 0; i < array.Length; i++)
            {
                Console.Write(array[i] + " ");
            }
            Console.ReadKey();
        }
    }

   
}

posted @ 2012-09-27 19:35  dingxyun  阅读(133)  评论(0)    收藏  举报