题型:综合题 题类:常考题 难易度:普通
浙江省宁波市九校2020-2021学年高二上学期信息技术期末联考试卷
Private Sub Command1_Click()
Dim x As Integer, m as double, n As Integer
Dim num1 as Long, num2 as Long
Dim s As String, flag as Boolean, i as Integer
x = val(Text1.Text)
m = x ^ 2
s = Trim(Str(m)) ‘Trim函数去除字符串首尾空格
n = len(s)
For i = 1 to n
num1 =
num2 = Val(Mid(s,i+1,n-i))
If Then
Flag = True
Exit For
End If
Next i
If flag Then
Label2.Caption=Str(x)+ "=" +Str(num1)+ "+" + mid(s,i+1)+ ",是卡布列克数!"
Else
Label2.Caption = Str(x) + "不是卡布列克数!"
End If
End Sub
试题篮