Vb字母金字塔问题
麻烦设计代码,急求!!!谢谢!!需要输出的图形为ABBBCCCCCDDDDDDDEEEEEEEEEFFFFFFFFFFFGGGGGGGGGGGGG先谢过啦!如完成,一定高...
麻烦设计代码,急求!!!谢谢!!
需要输出的图形为
A
BBB
CCCCC
DDDDDDD
EEEEEEEEE
FFFFFFFFFFF
GGGGGGGGGGGGG
先谢过啦!如完成,一定高分酬谢!
麻烦各位看下图在修改下! 展开
需要输出的图形为
A
BBB
CCCCC
DDDDDDD
EEEEEEEEE
FFFFFFFFFFF
GGGGGGGGGGGGG
先谢过啦!如完成,一定高分酬谢!
麻烦各位看下图在修改下! 展开
4个回答
展开全部
Option Base 1
Private Sub Command1_Click()
Dim a, i, z, b
a = Array("a", "b", "c", "d", "e", "f", "g")
b = Array("f", "e", "d", "c", "b", "a")
For i = 1 To 7
Print Tab(7 - i + 1);
For z = 1 To 2 * i - 1
Print a(i);
Next z
Next i
For i = 1 To 6
Print Tab(i + 1);
For z = 1 To (6 - i) * 2 + 1
Print b(i);
Next z
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim printstr As String
For i = 0 To 6
printstr = ""
For q = 5 To i Step -1
printstr = printstr & " "
Next
For w = 1 To (i * 2 + 1)
printstr = printstr & Chr(65 + i)
Next
Print printstr
Next
For i = 0 To 6
printstr = ""
For q = 5 To i Step -1
printstr = printstr & " "
Next
For w = 1 To (i * 2 + 1)
printstr = printstr & Chr(65 + i)
Next
Print printstr
Next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2009-04-15
展开全部
Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim n As Integer
n = 7
For i = 1 To n
Print Space$(n - i);
For j = 1 To (i * 2 - 1)
Print Chr(64 + i);
Next j
Print
Next i
For i = n - 1 To 1 Step -1
Print Space$(n - i);
For j = 1 To i
Print Chr(64 + i); Space$(1);
Next j
Print
Next i
End Sub
好了,和图中一模一样
Dim i As Integer
Dim j As Integer
Dim n As Integer
n = 7
For i = 1 To n
Print Space$(n - i);
For j = 1 To (i * 2 - 1)
Print Chr(64 + i);
Next j
Next i
For i = n - 1 To 1 Step -1
Print Space$(n - i);
For j = 1 To i
Print Chr(64 + i); Space$(1);
Next j
Next i
End Sub
好了,和图中一模一样
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'在窗体上放一个按钮,按钮单击代码如下
Private Sub Command1_Click()
Dim i, j As Integer
For i = 0 To 6
For j = 0 To i
Me.Print Chr(i + 65);
Next j
Me.Print Chr(13)
Next i
End Sub
Private Sub Command1_Click()
Dim i, j As Integer
For i = 0 To 6
For j = 0 To i
Me.Print Chr(i + 65);
Next j
Me.Print Chr(13)
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询