【发布时间】:2017-10-27 09:34:02
【问题描述】:
我想生成 (1 到 6) 之间的随机数,有没有办法改变获得数字 6 的机会比其他数字多?
例如这个代码
private void pictureBox5_MouseClick(object sender, MouseEventArgs e)
{
Random u = new Random();
m = u.Next(1,6);
label2.Text = m.ToString();
}
【问题讨论】:
-
搜索词:加权随机