如题所述
我自己编的软件,C#,不知道行不行
//hdghsugv制作private void button17_Click(object sender, EventArgs e)
{
if (fanwei1.Text == "" || fanwei2.Text == "")
{
MessageBox.Show("错误!");
}
else
{
int tmp1, tmp2;
int fw1 = Convert.ToInt32(fanwei1.Text);
int fw2 = Convert.ToInt32(fanwei2.Text);
if (fw1 < fw2)
{
if (fhjia.Checked == true)
{
Random r = new Random();
tmp1 = r.Next(fw1, fw2);
tmp2 = r.Next(fw1, fw2);
textBox87.Text = tmp1.ToString() + "+" + tmp2.ToString();
}
else if (fhjian.Checked == true)
{
Random r = new Random();
tmp1 = r.Next(fw1 + 10, fw2 + 10);
tmp2 = r.Next(fw1, fw2);
textBox87.Text = tmp1.ToString() + "-" + tmp2.ToString();
}
else if (fhcheng.Checked == true)
{
Random r = new Random();
tmp1 = r.Next(fw1 + 10, fw2 + 10);
tmp2 = r.Next(fw1, fw2);
textBox87.Text = tmp1.ToString() + "*" + tmp2.ToString();
}
}
else
{
MessageBox.Show("错误!");
}
}
}
望采纳
温馨提示:答案为网友推荐,仅供参考