Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim SumNegative As Double = 0
- Dim CountNegative As Integer = 0
- Dim NegativeAverage As Double
- If B < 0 Then
- SumNegative = SumNegative + B
- CountNegative = CountNegative + 1
- End If
- If D < 0 Then
- SumNegative = SumNegative + D
- CountNegative = CountNegative + 1
- End If
- If F < 0 Then
- SumNegative = SumNegative + F
- CountNegative = CountNegative + 1
- End If
- If CountNegative = 0 Then
- MsgBox "Ну, типа нечего нам считать"
- Else
- NegativeAverage = SumNegative / CountNegative
- End If
- Dim ProductOdd As Double = 1
- Dim CountOdd As Integer = 0
- Dim OddAverage As Double
- If B Mod 2 = 1 Then
- ProductOdd = ProductOdd * B
- CountOdd = CountOdd + 1
- End If
- If D Mod 2 = 1 Then
- ProductOdd = ProductOdd * D
- CountOdd = CountOdd + 1
- End If
- If F Mod 2 = 1 Then
- ProductOdd = ProductOdd * F
- CountOdd = CountOdd + 1
- End If
- If CountOdd = 0 Then
- MsgBox "Ну, типа нечего нам считать"
- Else
- OddAverage = ProductOdd ^ (1 / CountOdd)
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement