nynw.net
当前位置:首页 >> vB使用星号输出一个五行的直角三角形 >>

vB使用星号输出一个五行的直角三角形

For i = 1 To 5 Print String(i, "*")Next i

Private Sub Command1_Click() For i = 1 To 9 For j = 1 To i Print "*"; Next j Print Next i End Sub

Private Sub Form_Click() '点击窗体运行For i = 1 To 9 Print String(i, "*")Next iEnd Sub

Dim n As Integer n = 10 For i = 1 To n For k = 1 To n - i Print Chr(32); Next For j = 1 To i Print "*" & Chr(32); Next Print "" Next 放到Form_Paint()里面都可以。

在文本框的passwordchar属性里改为*就可以了。 例如:Private Sub Command1_Click() If Text1 = "" Then MsgBox "请输入关键字" WebBrowser1.SetFocus '先得到焦点 SendKeys Text1 '发送 SendKeys "{enter}" '回车 End Sub Private Sub Form_Loa...

觉得String(i,"*")不习惯,可以用常规的 For i = 1 To 6 '行数 For j = 1 To 7 - i '列数,随着i变大j变小 Print "*"; Next j Print '换行 Next i

Private Sub Command1_Click() n = 5 For i = 1 To n Print Space(n - i); For j = 1 To 2 * i - 1 Print "*"; Next j Print Next i End Sub

Private Sub Command1_Click() For i = 1 To 8 For j = 1 To 9 - i Print " "; Next j For j = 1 To 2 * i - 1 Print "*"; Next j For j = 1 To 10 Print " "; Next j For j = 1 To 2 * (9 - i) - 1 Print "*"; Next j Print Next i Print End Sub

Private Sub Command1_Click() For i = 0 To 3 For j = 0 To 3 - i Print " "; Next j For k = 0 To 2 * i + 1 Print "*"; Next k Print Next i For i = 0 To 2 For j = 0 To i + 1 Print " "; Next j For k = 0 To 4 - 2 * i Print "*"; Next k...

Sub ss() x1 = 20: y1 = 0 x2 = 1: y2 = 7 x3 = 39: y3 = 7 x4 = 8: y4 = 18 x5 = 32: y5 = 18 For i = 0 To 6 For j = 0 To 40 If j - x4 >= (x1 - x4) * (i - y4) / (y1 - y4) And j - x5 = (x2 - x5) * (i - y5) / (y2 - y5) And j - x5 = (x...

网站首页 | 网站地图
All rights reserved Powered by www.nynw.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com