人生的路还很长,还需要继续的学习,不断的充实自己!
题中的矩阵就死3*3的数组
Private Sub Command1_Click()
b = 1
For i = 1 To Len(Text1.Text)
a = Mid(Text1.Text, i, 1)
If a = "," Then
d = d + 1
e = Mid(Text1.Text, b, i - b)
b = i + 1
If e = "" Or e = "." Then e = 0
If Not IsNumeric(e) Then
MsgBox "你的第" & d & "个数输入错误", , "输入错误"
Exit Sub
End If
e = CCur(e)
If e > f Then
f = e
g = d
End If
Else
If i = Len(Text1.Text) Then
d = d + 1
e = Mid(Text1.Text, b, (i - b) + 1)
If e = "" Or e = "." Then e = 0
If Not IsNumeric(e) Then
MsgBox "你的第" & d & "个数输入错误", , "输入错误"
Exit Sub
End If
e = CCur(e)
If e > f Then
f = e
g = d
End If
End If
End If
Next i
Print Text1.Text
Print "最大的数" & f & ",在第" & g & "位."
End Sub
Private Sub Text1_Change()
For i = 1 To Len(Text1.Text)
If Mid(Text1.Text, i, 1) = "," Or IsNumeric(Mid(Text1.Text, i, 1)) Or Text1.Text = "" Or Mid(Text1.Text, i, 1) = "." Then
Else
Text1.Text = Mid(Text1.Text, 1, i - 1) & Mid(Text1.Text, i + 1, Len(Text1.Text))
MsgBox "请输入数值或分隔符(,)", , "输入错误"
Exit For
End If
Next
End Sub