📜  随机数生成器 c# 代码示例

📅  最后修改于: 2022-03-11 14:48:39.889000             🧑  作者: Mango

代码示例6
Random numberGen = new Random();
int amountToOutput = 4;
int minimumRange = 1;
int maximumRange = 20;

for(int i = 0; i < amountToOutput; i++)
{
  int randomNumber = numberGen.Next(minimumRange, maximumRange);
  Console.WriteLine(randomNumber);
}