用VB的循环结构编写数字金字塔
用VB的FOR循环结构编写数字金字塔,用print打印出来。题目:编写程序,打印如下所示的“数字金字塔”112112321123432112345432112345654...
用VB的FOR循环结构编写数字金字塔,用print打印出来。题目:编写程序,打印如下所示的“数字金字塔” 1 121 12321 1234321 123454321 12345654321 1234567654321 12345678765432112345678987654321
展开
3个回答
2013-05-12
展开全部
dim I as integerdim j as integerdim b as integer for i=1 to 9 '打印空格 for b=i to 9 print space(b) next '打印数字 for j=1 to i print j & "" next for j=i-1 to 1 print j & "" next'换行printnext
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
引用听不清啊的回答:
Private Sub Command1_Click()
For i = 1 To 9
Print Spc(9 - i);
For j = 1 To i
Print Chr(48 + j);
Next j
For j = i - 1 To 1 Step -1
Print Chr(48 + j);
Next j
Print
Next i
End Sub
Private Sub Command1_Click()
For i = 1 To 9
Print Spc(9 - i);
For j = 1 To i
Print Chr(48 + j);
Next j
For j = i - 1 To 1 Step -1
Print Chr(48 + j);
Next j
Next i
End Sub
展开全部
我试了一下,不对呀?怎么回事?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询