求VB编写的以"*" 菱形、三角形、 平行四边形、 直角反三角形、的代码 分不够了 我再加分。!!! 65
3个回答
展开全部
Private Sub Form_Click()
Dim I As Integer
For I = 1 To 7 '菱形
If I <= 4 Then
Print Space(4 - I); String(2 * I - 1, "*")
Else
Print Space(I - 4); String(15 - 2 * I, "*")
End If
Next I
Print
For I = 1 To 4 '三角形
Print Space(4 - I); String(2 * I - 1, "*")
Next I
Print
For I = 1 To 5 '平行四边形
Print Space(7 - I); String(7, "*")
Next I
Print
For I = 1 To 5 '直角反三角形
Print Space(2); String(6 - I, "*")
Next I
Print
For I = 1 To 5 '直角三角形
Print Space(2); String(I, "*")
Next I
Print
End Sub
Dim I As Integer
For I = 1 To 7 '菱形
If I <= 4 Then
Print Space(4 - I); String(2 * I - 1, "*")
Else
Print Space(I - 4); String(15 - 2 * I, "*")
End If
Next I
For I = 1 To 4 '三角形
Print Space(4 - I); String(2 * I - 1, "*")
Next I
For I = 1 To 5 '平行四边形
Print Space(7 - I); String(7, "*")
Next I
For I = 1 To 5 '直角反三角形
Print Space(2); String(6 - I, "*")
Next I
For I = 1 To 5 '直角三角形
Print Space(2); String(I, "*")
Next I
End Sub
追问
可以写下 反平行四边形的代码吗? 和乘加 乘除 代码。 没了呵呵。
追答
For I = 1 To 5 '反平行四边形
Print Space( I); String(7, "*")
Next I
2011-05-13
展开全部
Private Sub Command1_Click()
Cls
For i = 9 To 1 Step -2
Print String(i, "*")
Next i
End Sub
Private Sub Command2_Click()
Cls
For i = 1 To 7
Print Spc(i); String(7, "*")
Next i
End Sub
Private Sub Command3_Click()
Cls
For i = 1 To 7
Print Spc(20 - i); String(2 * i - 1, "*")
Next i
End Sub
Private Sub Command4_Click()
Cls
For i = -3 To 3
Print Spc(Abs(i)); String(7 - 2 * Abs(i), "*")
Next i
End Sub
Cls
For i = 9 To 1 Step -2
Print String(i, "*")
Next i
End Sub
Private Sub Command2_Click()
Cls
For i = 1 To 7
Print Spc(i); String(7, "*")
Next i
End Sub
Private Sub Command3_Click()
Cls
For i = 1 To 7
Print Spc(20 - i); String(2 * i - 1, "*")
Next i
End Sub
Private Sub Command4_Click()
Cls
For i = -3 To 3
Print Spc(Abs(i)); String(7 - 2 * Abs(i), "*")
Next i
End Sub
追问
j
追答
颜色没规律,写不了,除非你的颜色是随机的,如果是随机的,下面是棱形的代码。
Private Sub Command1_Click()
Cls
For i = -5 To 5
Print Spc(Abs(i));
For j = 1 To 11 - 2 * Abs(i)
Me.ForeColor = QBColor(Int(Rnd * 16))
Print "*";
Next j
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不懂你到底干嘛,可以说具体点乎?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询