修改时间:2024-07-13 浏览次数:170 类型:期末考试
图a
请回答下列问题:
Private Sub Command1_Click( )
Dim s As String, s1 As String, c1 As String, c2 As String
Dim i As Integer, t As Integer 't 用于统计相同字符的个数
c1 = Mid(s,1,1) : s1 = ""
t = 1
For i = 2 To Len(s)
c2 =
If c1 <> c2 Then
If t = 1 Then s1 = s1 + c1
t = 1
Else
t = t + 1
End If
Next i
Text2.Text = s1
End Sub
Private Sub Judge_Click( )
Dim x As Integer, i As Integer
Dim y As Long, flag As Boolean
flag = False
x = Val(Text1.Text)
i = 10
Label2.Caption = "该数的平方是:" + Str(y)
Do While y \ i > 0 And flag = False
t1 = y \ i
t2 = y Mod i
If Then
flag = True
Label3.Caption = Str(t1) + "+" + Str(t2) + " = " + Str(x)"
End If
i =
Loop
If Not flag Then Label3.Caption = "该数不是卡普利加数"
End Sub
试题篮