请教VB编程
12345654321123454321
1234321
12321
121
1
打印图形,如输入的行数为6,用for 循环和TAB函数,编的尽量简单些,易看懂 谢了
12345654321123454321
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
Next i