//方法1 private void button1_Click(object sender, EventArgs e) { float a; a = float.Parse(textBox1.Text); int b; b = float.Parse(textBox2.Text); int c; c = float.Parse(textBox3.Text); float d; d = (a + b) * c / 2; textBox4.Text = d.ToString(); } //方法2 private void button1_Click(object sender, EventArgs e) { int a; a = int.Parse(textBox1.Text); int b; b = int.Parse(textBox2.Text); int c; c = int.Parse(textBox3.Text); float d; d = (float)(a + b) * c / 2; textBox4.Text = d.ToString(); }