- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int x = Convert.ToInt32(comboBox1.Text);
switch (x)
{
case 2: textBox1.Visible=true;
textBox2.Visible = true;
textBox3.Visible = false;
textBox4.Visible = false;
textBox5.Visible = false;
textBox6.Visible = false;
textBox7.Visible = false;
textBox8.Visible = false;
textBox9.Visible = false;
textBox10.Visible = false;
break;
case 3:
textBox1.Visible = true;
textBox2.Visible = true;
textBox3.Visible = true;
textBox4.Visible = false;
textBox5.Visible = false;
textBox6.Visible = false;
textBox7.Visible = false;
textBox8.Visible = false;
textBox9.Visible = false;
textBox10.Visible = false;
break;
//и так до 10
//...
private void button1_Click(object sender, EventArgs e)
{
double p1 = 1 / Convert.ToDouble(textBox1.Text);
double p2 = 1 / Convert.ToDouble(textBox2.Text);
double p3 = 1 / Convert.ToDouble(textBox3.Text);
double p4 = 1 / Convert.ToDouble(textBox4.Text);
double p5 = 1 / Convert.ToDouble(textBox5.Text);
double p6 = 1 / Convert.ToDouble(textBox6.Text);
double p7 = 1 / Convert.ToDouble(textBox7.Text);
double p8 = 1 / Convert.ToDouble(textBox8.Text);
double p9 = 1 / Convert.ToDouble(textBox9.Text);
double p10 = 1 / Convert.ToDouble(textBox10.Text);
double inv;
int x = Convert.ToInt32(comboBox1.Text);
switch (x)
{
case 2:
inv=(1/p1+1/p2);
break;
case 3:
inv = ((1 / p1) + (1 / p2)+(1/p3));
break;
case 4:
inv = ((1 / p1) + (1 / p2) + (1 / p3)+(1/p4));
break;
case 5:
inv = ((1 / p1) + (1 / p2) + (1 / p3) + (1 / p4)+(1/p5));
break;
case 6:
inv = ((1 / p1) + (1 / p2) + (1 / p3) + (1 / p4) + (1 / p5)+(1/p6));
break;
case 7:
inv = ((1 / p1) + (1 / p2) + (1 / p3) + (1 / p4) + (1 / p5) + (1 / p6) + (1 / p7));
break;
case 8:
inv = ((1 / p1) + (1 / p2) + (1 / p3) + (1 / p4) + (1 / p5) + (1 / p6) + (1 / p7) + (1 / p8));
break;
case 9:
inv = ((1 / p1) + (1 / p2) + (1 / p3) + (1 / p4) + (1 / p5) + (1 / p6) + (1 / p7) + (1 / p8) + (1 / p9));
break;
case 10:
inv = ((1 / p1) + (1 / p2) + (1 / p3) + (1 / p4) + (1 / p5) + (1 / p6) + (1 / p7) + (1 / p8) + (1 / p9) + (1 / p10));
break;
double rez = 1 / inv;
textBox11.Text = Convert.ToString(rez);
}
}
Lure Of Chaos 17.03.2011 00:34 # 0
istem 17.03.2011 02:18 # +2
ingenuus 17.03.2011 09:08 # +2
absolut 17.03.2011 09:21 # 0
TarasB 17.03.2011 15:52 # 0
absolut 17.03.2011 16:22 # 0
Анонимус 17.03.2011 17:04 # +6
gegMOPO4 18.03.2011 14:44 # 0
absolut 18.03.2011 15:12 # 0
gegMOPO4 18.03.2011 15:36 # 0
absolut 18.03.2011 16:00 # 0
gegMOPO4 18.03.2011 16:36 # 0