111,129
社区成员
发帖
与我相关
我的任务
分享 private void button1_Click(object sender, EventArgs e)
{
Random r = new Random(Guid.NewGuid().GetHashCode());
int iOne = 0,iTwo=0;
for (int i = 0; i < 10000; i++)
{
iOne = r.Next(1, 100);
iTwo = r.Next(0, iOne);
listBox1.Items.Add(iOne.ToString() + "-" + iTwo.ToString() + "=" + (iOne-iTwo).ToString());
}
}Randomize rand = new Randomize(Environment.TickCount);
public string GetOne()
{
int a = rand.Next(1,100);
int b = rand.Next(1,100);
return Math.Max(a,b).ToString()+"-"+Math.Min(a,b).ToString();
}