vb的一个图形题,求大虾详解,感激不尽
1.编写程序,使用双循环输出下列三角形 D D D D D D D
C C C C C
B B B
A
解:
Private Sub Button1_Click
( ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim i, j As Integer
Dim str1 As String
Dim p As String = "D"
For i = 1 To 4
For j = 1 To 20 + 2 * i
str1 = str1 + " "
Next
For j = 1 To 9 - i * 2
str1 = str1 + p + " "
Next
str1 = str1 + Chr(10)
p = Chr(Asc(p) - 1)
Next
MsgBox(str1)
End Sub
那个i,j有什么用,完全看不懂这个题。跪求哪个好心人解释解释