string[] arr = { "张三", "李四", "王五", "Curry", "James", "Kobe" }; Random rand = new Random();//实例化rand string name1 = arr[rand.Next(0, arr.Length)]; //string name2 = arr[rand.Next(0, arr.Length)]; Console.WriteLine("恭喜{0}中奖了", name1);
2021-07-12 00:43:42
string[] arr = { "张三", "李四", "王五", "Curry", "James", "Kobe" }; Random rand = new Random();//实例化rand string name1 = arr[rand.Next(0, arr.Length)]; //string name2 = arr[rand.Next(0, arr.Length)]; Console.WriteLine("恭喜{0}中奖了", name1);
下一篇:python操作redis