C# 随机抽取一个数字

版权声明:LinZeXian https://blog.csdn.net/weixin_44538319/article/details/86514982

	Random myRandom = new Random();//创建一个随机对象
    int RandomNumber = myRandom.Next(1,10);//在1至10里随机抽取一个数字
    Console.WriteLine(RandomNumber);
    Console.ReadLine();
    

猜你喜欢

转载自blog.csdn.net/weixin_44538319/article/details/86514982