代码如下:
private void buttonCap_Click(object sender, EventArgs e) { double f0, L, C, H,result; const double conpi = 3.1415926; f0 = double.Parse(textBoxF.Text); L = double.Parse(textBoxL.Text); H=f0*f0*L; result = 4 * (conpi *conpi) * H; C = 1 / result; textBoxC.Text = C.ToString(); }
首先定义各个变量,然后带入,得结果。但是如何进行单位换算呢。。。