1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 using System.Threading.Tasks;
 6 
 7 namespace ConsoleApplication1
 8 {
 9     class Program
10     {
11         static void Main(string[] args)
12         {
13             Random r = new Random();
14             int b = r.Next(0, 9);
15             Console.WriteLine("{0}",b);
16         }
17     }
18 }
Next原型:
1 public virtual int Next(
2     int minValue,
3     int maxValue
4 )

第一个控制最小值,

第二个控制最大值。

 

相关文章:

  • 2021-11-16
  • 2021-10-02
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2021-07-30
  • 2021-06-04
  • 2021-11-08
猜你喜欢
  • 2022-03-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案