vb 打印空心菱形问题!!请高手帮忙写一下!谢谢!
其中行数和列数不定有输入的数字确定!!请帮忙写一下!!刚开始学所有有点难不会做,请高手帮助!!谢谢!...
其中行数和列数不定有输入的数字确定!!请帮忙写一下!!刚开始学所有有点难不会做,请高手帮助!!谢谢!
展开
展开全部
创建一个按钮commmand1
复制以下代码:
Option Explicit
Private Sub Command1_Click()
Dim i As Integer, n As Integer
Dim j As Integer
For i = 1 To 7
Print Tab(20 - i);
For j = 1 To 2 * i - 1
If j = 1 Or j = 2 * i - 1 Then
Print "*";
Else
Print " ";
End If
Next
Print
Next
n = i - 2
For i = n To 1 Step -1
Print Tab(20 - i);
For j = 1 To 2 * i - 1
If j = 1 Or j = 2 * i - 1 Then
Print "*";
Else
Print " ";
End If
Next
Print
Next
End Sub
复制以下代码:
Option Explicit
Private Sub Command1_Click()
Dim i As Integer, n As Integer
Dim j As Integer
For i = 1 To 7
Print Tab(20 - i);
For j = 1 To 2 * i - 1
If j = 1 Or j = 2 * i - 1 Then
Print "*";
Else
Print " ";
End If
Next
Next
n = i - 2
For i = n To 1 Step -1
Print Tab(20 - i);
For j = 1 To 2 * i - 1
If j = 1 Or j = 2 * i - 1 Then
Print "*";
Else
Print " ";
End If
Next
Next
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询