Private Sub Command1_Click()
Dim a(1 To 51) As Integer, b(1 To 51) As Integer, c(1 To 51) As Integer Dim lens1 As String, lens2 As String
lens1 = Len(Text1.Text) :lens2 = Len(Text2.Text)
For i = Len(Text1.Text) To 1 Step -1 ‘讀取數(shù)據(jù),逐位保存在數(shù)組中
a(i) = Mid(Text1.Text, lens1 - i + 1, 1) Next i
For i = Len(Text2.Text) To 1 Step -1
b(i) = Mid(Text2.Text, lens2 - i + 1, 1) Next i
For i = 1 To 51 ‘從個位到高位逐位求和
c(i) =
If c(i) > 9 Then
c(i) = c(i) - 10
c(i + 1)=
End If Next i
f = False '從左到右輸出第一個不為 0 的元素開始從高位到低位輸出和
For i = 51 To 1 Step -1
If c(i) <> 0 Then f = True
If f Then Text3.Text = Text3.Text & c(i) Next i
End Sub