decRZ1 = Val(txtRZ1.Text)
decRZ2 = Val(txtRZ2.Text)
decRZ3 = Val(txtRZ3.Text)
decRZ4 = Val(txtRZ4.Text)
decRZ5 = Val(txtRZ5.Text)
If decRZ1 * x1 + decRZ2 * x2 + decRZ3 * x3 + decRZ4 * x4 + decRZ5 * x5 >= 4950
And x1 + x2 + x3 + x4 + x5= 1 Then
If min > decRZ1 * x1 + decRZ2 * x2 + decRZ3 * x3 + decRZ4 * x4 + decRZ5 * x5 Then
min = decRZ1 * x1 + decRZ2 * x2 + decRZ3 * x3 + decRZ4 * x4 + decRZ5 * x5
lblZJXZJG.Text = String.Format("{0:C}", min)
如果RZ1,RZ2,RZ3都有值取了,但是RZ4,RZ5都沒有值取的時候,停止RZ4,RZ5的取值過程,只運算RZ1,RZ2,RZ3不要RZ4,RZ5。如何表達呢?請詳細解釋,我是菜鳥。
decBMJG1 = (decKKJ1 + decYF1 * 0.93) * 7000 / decRZ1
decBMJG2 = (decKKJ2 + decYF2 * 0.93) * 7000 / decRZ2
decBMJG3 = (decKKJ3 + decYF3 * 0.93) * 7000 / decRZ3
decBMJG4 = (decKKJ4 + decYF4 * 0.93) * 7000 / decRZ4
decBMJG5 = (decKKJ5 + decYF5 * 0.93) * 7000 / decRZ5
decRZ1 = Val(txtRZ1.Text)
decRZ2 = Val(txtRZ2.Text)
decRZ3 = Val(txtRZ3.Text)
decRZ4 = Val(txtRZ4.Text)
decRZ5 = Val(txtRZ5.Text)
If decRZ1 * x1 + decRZ2 * x2 + decRZ3 * x3 + decRZ4 * x4 + decRZ5 * x5 >= 4950
And x1 + x2 + x3 + x4 + x5= 1 Then
If min > decRZ1 * x1 + decRZ2 * x2 + decRZ3 * x3 + decRZ4 * x4 + decRZ5 * x5 Then
min = decRZ1 * x1 + decRZ2 * x2 + decRZ3 * x3 + decRZ4 * x4 + decRZ5 * x5
lblZJXZJG.Text = String.Format("{0:C}", min)
如果RZ1,RZ2,RZ3都有值取了,但是RZ4,RZ5都沒有值取的時候,停止RZ4,RZ5的取值過程,只運算RZ1,RZ2,RZ3不要RZ4,RZ5。如何表達呢?請詳細解釋,我是菜鳥。
decBMJG1 = (decKKJ1 + decYF1 * 0.93) * 7000 / decRZ1
decBMJG2 = (decKKJ2 + decYF2 * 0.93) * 7000 / decRZ2
decBMJG3 = (decKKJ3 + decYF3 * 0.93) * 7000 / decRZ3
decBMJG4 = (decKKJ4 + decYF4 * 0.93) * 7000 / decRZ4
decBMJG5 = (decKKJ5 + decYF5 * 0.93) * 7000 / decRZ5