你们好,我是九旅网的小编小九,vb程序设计基础知识点,vb程序设计很多人还不知道,现在让我们一起来看看吧!
Private Sub Command1_Click()
Dim N As Integer
N = Val(InputBox("请输入一个整数"))
For i = 1 To N
S = ""
For j = 1 To i
S = S + "*"
Next j
Print S
Next i
End Sub
看不懂题目在写什么,随便谢谢 s(n)是不能这样定义数组的
Private Sub Command1_Click()
Dim N As Integer
N = Val(InputBox("请输入一个整数"))
Dim S(N) As Integer
For i = 1 To N
Randomize
S(i) = Int((10 * Rnd) + 1)
Next i
For i = 1 To N
Print S(i)
Next i
End Sub
Private Sub Command1_Click()
Randomize
Dim a(10)
For j = 1 To 10
a(j) = Int(100 * Rnd)
If a(j) Mod 5 = 0 Then k = k + 1
Print a(j)
Next j
Print k / 10
End Sub
Private Sub Command1_Click()
Text1.BackColor = vbRed
Text1.FontSize = 40
Text1.FontName = "黑体"
Text1.FontBold = True
End Sub
本文到此讲解完毕了,希望对大家有帮助。