当前位置:编程学习 > VB >>

请教VB编程

12345654321

123454321

1234321

12321

121

1

打印图形,如输入的行数为6,用for 循环和TAB函数,编的尽量简单些,易看懂 谢了

答案:你这个不需要tab函数,以下为程序

Dim n As Long, i As Long, j As Long
n = InputBox("请输入行数")
If n <= 0 Then Exit Sub
For i = n To 1 Step -1
For j = 1 To i
Print Trim(j);
Next j
For j = i - 1 To 1 Step -1
Print Trim(j);
Next j
Print
Next i

上一个:VB编程问题
下一个:VB编程问题。

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,