Private Sub Command1_Click() Dim i, j As Integer Dim s As String For i = 1 To 7 If i <= 4 Then For j = 1 To 2 * i - 1 s = s & Space(1) & i Next j Print Tab(9 - 2 * i); s s = "" Else For j = 1 To 15 - 2 * i s = s & Space(1) & i Next j Print Tab(2 * i - 7); s s = "" End If Next i End Sub 呵呵,再来个新的!!
Private Sub Form_Load() Form1.Show For i = 0 To 2 For j = 25 - i To (25 + i) Step 2 If i >= 0 Then Print Tab(j); CStr(i + 1); End If Next j Next i For i = 3 To 0 Step -1 For j = 25 - i To (25 + i) Step 2 If i >= 0 Then Print Tab(j); CStr(i + K + 1); End If Next j K = K + 2 Next i End Sub
Private Sub Form_Load() Form1.Show For i = 0 To 2 For j = 25 - i To (25 + i) If i >= 0 Then Print Tab(j); CStr(i + 1); End If Next j Next i For i = 3 To 0 Step -1 For j = 25 - i To (25 + i) If i >= 0 Then Print Tab(j); CStr(i + K + 1); End If Next j K = K + 2 Next i End Sub
Private Sub Form_Click() For i = 1 To 7 If i <= 4 Then Print Tab(7 - i); String(2 * i - 1, CStr(i)): j = 3 Else Print Tab(7 - j); String(2 * j - 1, CStr(i)) j = j - 1 End If Next i End Sub
Private Sub Form_Click() '连续单击窗体观查结果 Static b As Integer b = b + 1 If b > 5 Then b = 1 a = 2 * b - 1 '打印行数(3,5,7,9)
For i = 1 To a \ 2 + 1 n = 7 \ 2 - i + 10 Debug.Print Spc(n); For j = 1 To i * 2 - 1 Debug.Print CStr(i); Next Debug.Print Next For i = 1 To a \ 2 Debug.Print Spc(i + n); For j = 1 To a - i * 2 Debug.Print CStr(i + a \ 2 + 1); Next Debug.Print Next Debug.Print End Sub
Private Sub Form_Click() '连续单击窗体观查结果 Static b As Integer b = b + 1 If b > 5 Then b = 1 a = 2 * b - 1 '打印行数(3,5,7,9)
For i = 1 To a \ 2 + 1 n = 7 \ 2 - i + 10 Debug.Print Spc(n); Debug.Print String(i * 2 - 1, CStr(i)) Next For i = 1 To a \ 2 Debug.Print Spc(i + n); Debug.Print String(a - i * 2, CStr(i + a \ 2 + 1)) Next Debug.Print End Sub
Print Tab(10); 1
Print Tab(7); 2; 2; 2
Print Tab(4); 3; 3; 3; 3; 3
Print 4; 4; 4; 4; 4; 4; 4
Print Tab(4); 5; 5; 5; 5; 5
Print Tab(7); 6; 6; 6
Print Tab(10); 7
End Sub
给分,下面还有……
不给就没了……
print " 2 2 2 "
print " 3 3 3 3 3 "
print " 4 4 4 4 4 4 4"
print " 5 5 5 5 5 "
print " 6 6 6 "
print " 7 "
print " 2 2 2"
print " 3 3 3 3 3"
print " 4 4 4 4 4 4 4"
print " 5 5 5 5 5"
print " 6 6 6"
print " 7"
Dim i, j As Integer
Dim s As String
For i = 1 To 7
If i <= 4 Then
For j = 1 To 2 * i - 1
s = s & Space(1) & i
Next j
Print Tab(9 - 2 * i); s
s = ""
Else
For j = 1 To 15 - 2 * i
s = s & Space(1) & i
Next j
Print Tab(2 * i - 7); s
s = ""
End If
Next i
End Sub
呵呵,再来个新的!!
Form1.Show
For i = 0 To 2
For j = 25 - i To (25 + i) Step 2
If i >= 0 Then
Print Tab(j); CStr(i + 1);
End If
Next j
Next i
For i = 3 To 0 Step -1
For j = 25 - i To (25 + i) Step 2
If i >= 0 Then
Print Tab(j); CStr(i + K + 1);
End If
Next j
K = K + 2
Next i
End Sub
Form1.Show
For i = 0 To 2
For j = 25 - i To (25 + i)
If i >= 0 Then
Print Tab(j); CStr(i + 1);
End If
Next j
Next i
For i = 3 To 0 Step -1
For j = 25 - i To (25 + i)
If i >= 0 Then
Print Tab(j); CStr(i + K + 1);
End If
Next j
K = K + 2
Next i
End Sub
For i = 1 To 7
If i <= 4 Then
Print Tab(7 - i); String(2 * i - 1, CStr(i)): j = 3
Else
Print Tab(7 - j); String(2 * j - 1, CStr(i))
j = j - 1
End If
Next i
End Sub
Private Sub Form_Click() '连续单击窗体观查结果
Static b As Integer
b = b + 1
If b > 5 Then b = 1
a = 2 * b - 1 '打印行数(3,5,7,9)
For i = 1 To a \ 2 + 1
n = 7 \ 2 - i + 10
Debug.Print Spc(n);
For j = 1 To i * 2 - 1
Debug.Print CStr(i);
Next
Debug.Print
Next
For i = 1 To a \ 2
Debug.Print Spc(i + n);
For j = 1 To a - i * 2
Debug.Print CStr(i + a \ 2 + 1);
Next
Debug.Print
Next
Debug.Print
End Sub
Private Sub Form_Click() '连续单击窗体观查结果
Static b As Integer
b = b + 1
If b > 5 Then b = 1
a = 2 * b - 1 '打印行数(3,5,7,9)
For i = 1 To a \ 2 + 1
n = 7 \ 2 - i + 10
Debug.Print Spc(n);
Debug.Print String(i * 2 - 1, CStr(i))
Next
For i = 1 To a \ 2
Debug.Print Spc(i + n);
Debug.Print String(a - i * 2, CStr(i + a \ 2 + 1))
Next
Debug.Print
End Sub