VB的小问题~~~~急~~~~~~~在线等,高分!!!

来源:百度知道 编辑:UC知道 时间:2024/05/27 03:38:41
题目:把在两个TEXT控件里的数组成的区间里能被3和5整除的显示在第三个TEXT控件里
VB的问题,速度,在线等
麻烦写出完整的步骤,谢谢大家了~~~

private sub command1_click()
dim a , b ,t as integer
a = int(val(text1.text))
b = int(val(text2.text))
start:
if a > b then
for i = b to a step 1
if i mod 3=0 and i mod 5 =0 then
text3.text = i & text3.text
end if
next i
else
t = a
a = b
b = t
goto start
enf if
end sub

private sub command1_click()
dim a as integer , b as integer,t as integer
a = val(text1.text)
b = val(text2.text)
text3=""
if a > b then
t=a
a=b
b=t
endif
for i = a to b
if i mod 15=0 then text3.text = text3.text & i & " "

next i

end sub

画三个Text控件,一个Command控件,还有记得把Text3的Multiline属性设置为true,在text1和text2里面输入范围就可以了,Command1点击代码见下:
Private Sub Command1_Click()
Dim i, j, m, n As Integer
m = Text1.Text
n = Text2.Text
Text3.Text = ""
For i = m To n
If i Mod 3 = 0 And i