用vb编程,打印如下图形
*#########**#######**#####**###**#***#**###**#####**#######**#########*...
*#########*
*#######*
*#####*
*###*
*#*
*
*#*
*###*
*#####*
*#######*
*#########* 展开
*#######*
*#####*
*###*
*#*
*
*#*
*###*
*#####*
*#######*
*#########* 展开
展开全部
Private Sub Command1_Click()
Dim N As Integer
N = 6 '需要输出的行数
'如果前面没有空格
For i = 1 To 2 * N + 1
For j = 1 To Abs(i - N - 1) * 2 + 1
If j = 1 Or j = Abs(i - N - 1) * 2 + 1 Then
Print "*";
Else
Print "#";
End If
Next
Print
Next
Print
Print
'如果是左右对称
For i = 1 To 2 * N + 1
Print Tab(N - Abs(N - i + 1) + 1);
For j = 1 To Abs(i - N - 1) * 2 + 1
If j = 1 Or j = Abs(i - N - 1) * 2 + 1 Then
Print "*";
Else
Print "#";
End If
Next
Next
End Sub
Dim N As Integer
N = 6 '需要输出的行数
'如果前面没有空格
For i = 1 To 2 * N + 1
For j = 1 To Abs(i - N - 1) * 2 + 1
If j = 1 Or j = Abs(i - N - 1) * 2 + 1 Then
Print "*";
Else
Print "#";
End If
Next
Next
'如果是左右对称
For i = 1 To 2 * N + 1
Print Tab(N - Abs(N - i + 1) + 1);
For j = 1 To Abs(i - N - 1) * 2 + 1
If j = 1 Or j = Abs(i - N - 1) * 2 + 1 Then
Print "*";
Else
Print "#";
End If
Next
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询