Visual BasicВыделить код
Option Explicit
Function Min_3(a As Variant, b As Variant, c As Variant) As Variant
Min_3 = a
If a > b Then Min_3 = b
If Min_3 > c Then Min_3 = c
End Function
Private Sub Form_Activate()
Dim a As Integer, b As Integer, c As Integer
a = Val(InputBox("Введите число"))
b = Val(InputBox("Введите число"))
c = Val(InputBox("Введите число"))
Print "Наименьшее из чисел " & a & ", " & b & ", " & c & " - число " & Min_3(a, b, c)
End Sub
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Visual BasicВыделить код
Option Explicit
Function Min_3(a As Variant, b As Variant, c As Variant) As Variant
Min_3 = a
If a > b Then Min_3 = b
If Min_3 > c Then Min_3 = c
End Function
Private Sub Form_Activate()
Dim a As Integer, b As Integer, c As Integer
a = Val(InputBox("Введите число"))
b = Val(InputBox("Введите число"))
c = Val(InputBox("Введите число"))
Print "Наименьшее из чисел " & a & ", " & b & ", " & c & " - число " & Min_3(a, b, c)
End Sub