![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
vb小白,判断整数是否能被3或者7整除的代码,输入后显示子函数未定义
PrivateSubCommand1_Click()DimnAsInteger,rAsStringn=Val(Text1.Text)IfnMod3=0)And(nMod7...
Private Sub Command1_Click()
Dim n As Integer, r As String
n = Val(Text1.Text)
If n Mod 3 = 0) And (n Mod 7 = 0) Then
Label1.Caption = n & "yes"
Eles
Label2.Caption = n & "no"
End If
Label2.Caption = r
求帮忙看一下 展开
Dim n As Integer, r As String
n = Val(Text1.Text)
If n Mod 3 = 0) And (n Mod 7 = 0) Then
Label1.Caption = n & "yes"
Eles
Label2.Caption = n & "no"
End If
Label2.Caption = r
求帮忙看一下 展开
2个回答
展开全部
Private Sub Command1_Click()
Dim n As Integer, r As String
n = Val(Text1.Text)
If (n Mod 3 = 0) And (n Mod 7 = 0) Then
Label1.Caption = n & "yes"
else
Label2.Caption = n & "no"
End If
Label2.Caption = r
END SUB
追问
判断为yes的时候结果也是要出现在
label2里但是改成label2 就出不来结果,肿么回事啊···
追答
把最后一句 Label2.Caption = r去掉
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询