【发布时间】:2019-06-19 17:16:47
【问题描述】:
Dim Temp(3), Difference As Double
Dim i As Integer
Const UpperBound As Double = 37.5
Const LowerBound As Double = 36
For i = 1 To 3
Console.WriteLine("Enter the temeperature of the baby.")
Temp(i) = Console.ReadLine()
If Temp(i) > UpperBound Or Temp(i) < LowerBound Then
Console.WriteLine("The temperature is not in the correct range.")
Else Console.WriteLine("The temperature is within acceptable range.")
End If
Next
Console.WriteLine("The minimum temperature is " & Temp.Min)
Console.WriteLine("The maximum temperature is " & Temp.Max)
Difference = Temp.Max - Temp.Min
Console.WriteLine("The difference is " & Difference)
Console.ReadKey()
我得到的不是最小值,而是 0
【问题讨论】:
-
欢迎来到 SO。今后,请花时间正确格式化您的代码。