模拟发牌(随机不重复)

来源:互联网 发布:mac系统怎么卸载flash 编辑:程序博客网 时间:2024/05/17 04:08

随机不重复

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace net{    class Hello    {        //模拟随机发牌        static void Main()        {            HashSet<int> hs = new HashSet<int>();            Random rd = new Random();            for (int i = 0; i < 54;i++ )             {                hs.Add(rd.Next(54));            }            foreach (var item in hs)            {                Console.WriteLine(item);            }        }    }}
0 0
原创粉丝点击