private void button7_Click(object sender, EventArgs e)
{
Random r1 = new Random(1234567);
List<int> l1 = new List<int>();
for (int i = 0; i < 10; i++)
l1.Add(r1.Next(9));
Random r2 = new Random(1234567);
List<int> l2 = new List<int>();
for (int i = 0; i < 10; i++)
l2.Add(r2.Next(9));
bool isAllEquals = true;
for (int i = 0; i < 10; i++)
{
if (l1[i] != l2[i])
isAllEquals = false;
}
StringBuilder sb = new StringBuilder();
sb.Append($"生成是否相同:{isAllEquals}\n具体随机的数字为:\n");
for (int i = 0; i < 10; i++)
sb.Append(l1[i]).Append(",");
MessageBox.Show(sb.ToString());
}