首页 > 代码库 > C#随机双色球

C#随机双色球

using System;using System.Collections.Generic;namespace ConsoleApplicationRandnumber{    class Program    {        static void Main(string[] args)        {            List<int> arr = new List<int>(6);            arr = redNumber();            Console.Write("红色球随机:\n");            for (int i = 0; i < 6; i++)            {                Console.Write("{0}"+"  ",arr[i]);            }            int bNumber = blueNumber();            Console.WriteLine("\n蓝色球随机:\n{0}",bNumber);            Console.ReadLine();        }                /// <summary>        /// 从1到33中选取不重复的6个随机数        /// </summary>        /// <returns></returns>        public static List<int> redNumber()        {            //用于存放1-33这33个数            List<int> container = new List<int>(33);            //用于保存返回结果            List<int> result = new List<int>(6);            Random random = new Random();            for (int i = 1; i <= 33; i++)            {                container.Add(i);            }            int index = 0;            int value = http://www.mamicode.com/0;>