题型:综合题 题类:常考题 难易度:困难
浙江省嘉兴市2018-2019学年高二下学期信息技术期末考试试卷一
Private Sub Command1_Click()
Dim m1 As String, m2 As String, sum As String ,t As String
Dim n1 As Integer, n2 As Integer, k As Integer, x As Integer
m1 = Text1.Text:m2 = Text2.Text
If Then t = m1: m1 = m2: m2 = t
x = Len(m1) - Len(m2)
Do While x > 0
m2 = "0" + m2
x = x - 1
Loop
n = Len(m1): sum = "": k = 0
Do While n > 0
n1 = Val(Mid(m1, n, 1))
n2 = Val(Mid(m2, n, 1))
sum = Str((n1 + n2 + k) Mod 2) + sum
n = n - 1
Loop
If k <> 0 Then sum = Str(k) + sum
Label4.Caption = sum
End Sub
试题篮