vb语言这个图形怎么打 空格用tab()的代码
展开全部
Private Sub Command2_Click()
For i = 1 To 5
Print Tab(12 - 2 * i + 1); CStr(1);
For j = 2 To 2 * i - 1
If j <= i Then
Print Space(1) + CStr(j);
Else
Print Space(1) + CStr(2 * i - j);
End If
Next j
Next i
For i = 4 To 1 Step -1
Print Tab(12 - 2 * i + 1); CStr(1);
For j = 2 To 2 * i - 1
If j <= i Then
Print Space(1) + CStr(j);
Else
Print Space(1) + CStr(2 * i - j);
End If
Next j
Next i
End Sub
Private Sub Command1_Click()
For i = 1 To 5
Print Tab(6 - i); CStr(1);
For j = 2 To 2 * i - 1
If j <= i Then
Print CStr(j);
Else
Print CStr(2 * i - j);
End If
Next j
Next i
For i = 4 To 1 Step -1
Print Tab(6 - i); CStr(1);
For j = 2 To 2 * i - 1
If j <= i Then
Print CStr(j);
Else
Print CStr(2 * i - j);
End If
Next j
Next i
End Sub
追问
Cstr是什么? 有些时候数字之间有空格 怎么办
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询