vb求和语言
答案:3 悬赏:10 手机版
解决时间 2021-03-31 14:16
- 提问者网友:不要迷恋哥
- 2021-03-31 11:21
vb求和语言
最佳答案
- 五星知识达人网友:毛毛
- 2021-03-31 12:14
Private Sub Command1_Click()
a = Val(Text1)
s = Len(a)
Sum = 0
For i = 1 To s
Sum = Sum + a Mod 10
a = a \ 10
Next i
Text2 = Str(Sum)
End Sub
Private Sub Command2_Click()
Text1 = ""
Text1.SetFocus
Text2 = ""
End Sub
Private Sub Command3_Click()
End
End Sub
a = Val(Text1)
s = Len(a)
Sum = 0
For i = 1 To s
Sum = Sum + a Mod 10
a = a \ 10
Next i
Text2 = Str(Sum)
End Sub
Private Sub Command2_Click()
Text1 = ""
Text1.SetFocus
Text2 = ""
End Sub
Private Sub Command3_Click()
End
End Sub
全部回答
- 1楼网友:轻熟杀无赦
- 2021-03-31 14:51
Private Sub Command1_Click()
Dim sum As Integer, i As Integer
s = 0
For i = 1 To Len(Text1.Text)
s = s + Val(Mid(Text1.Text, i, 1))
Next i
Text2.Text = Str(s)
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
End
End Sub
Dim sum As Integer, i As Integer
s = 0
For i = 1 To Len(Text1.Text)
s = s + Val(Mid(Text1.Text, i, 1))
Next i
Text2.Text = Str(s)
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
End
End Sub
- 2楼网友:白昼之月
- 2021-03-31 13:21
老大,一个数字怎么求和啊?
你这个提完全了是基础啊。。。
求和:text3=ext1+text2
清除并焦点:text1="":tex2="":text1.sefocus
结束:unload me
你这个提完全了是基础啊。。。
求和:text3=ext1+text2
清除并焦点:text1="":tex2="":text1.sefocus
结束:unload me
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯