Private Sub Command1_Click()
Dim i, k As Integer
Dim x1, y1, x2, y2 As Single
Dim v As Singie, maxd As Single
Dim s As String, pos zb As String
List1.Clear
s=Text1.Text
x1=1: y1=1
t="": k=1: j=1
List1.AddItem"坐标点" & "距离"
For i=1 To Len(s)
If Mid(s, i, 1)="," Then
v=Val(Mid(s,j,i-j))
j=
If k Mod 2=1 Then
x2=v
Else
y2=v
d=Sqr((x2-x1)^2+(y2-y1)^2)
If Then
maxd=d
pos="(" & Str(x2)& "," & Str(y2)& ")"
End If
List1.AddItem"(" & Str(x2)& "," & Str(y2)& ")" & Str(d)
End If
k=k+1
End If
Next i
Label1.Caption="距离(1, 1)最远的点为"& pos &"距离为"& Str(maxd)
End Sub