Private Sub Command1_Click()
Dim n As Single, i As Integer, c As Integer
List1.Clear
n = Val(Text1.Text)
If n - Int(n) > 0.5 Then
n = Int(n)+1 ‘n 小数部分大于 0.5 的加 1,0.5 及以下的加 0.5
Else
End If
c = n * 2 - 10
Label1.Caption = "适合你的鞋码为:" + Str(c)
For i = 22.5 To n+2 step 0.5
If Int(i) = i Then
List1.AddItem Str(i) + " " + Str(c)
Else
List1.AddItem Str(i) + " " + Str(c)
End If
Next i
End Sub