哎 好麻烦的题啊因,,写的脑壳痛不过写出来了Private Sub Command1_Click()Dim a, b As IntegerDim t1, t2,
1条回答
1楼 · 2024-07-08 13:46.采纳回答
哎 好麻烦的题啊因,,写的脑壳痛 不过写出来了
Private Sub Command1_Click() Dim a, b As Integer Dim t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 As String For i = 0 To 999 a = 0
For j = 1 To 3 i = Format(i, "000") If Mid(i, j, 1) = 1 Or Mid(i, j, 1) = 4 Or Mid(i, j, 1) = 7 Then a = a + 1 If Mid(i, j, 1) = 2 Or Mid(i, j, 1) = 5 Or Mid(i, j, 1) = 8 Then a = a + 10 Next j If Mid(i, 1, 1) > Mid(i, 2, 1) Or Mid(i, 2, 1) > Mid(i, 3, 1) Then a 器村升两认须没磁倒交市= -1 Select Case a Case 0: t1 = t1 & i & " " Case 3: t2 = t2 & i & " " Case 30: t3 = t3 & i & " " Case 1: t4 = t4 & i & " " Case 10: t5 = t5 & i & " " Case 2: t6 = t6 & i & " " Case 11: 领t7 = t7 & i & " " Case 20: t8 = t8 & i & " " Case 12: t9 = t9 & i & " " Case 21: t10 = t10 & i & " "
不过写出来了
Private Sub Command1_Click()
Dim a, b As Integer
Dim t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 As String
For i = 0 To 999
a = 0
For j = 1 To 3
i = Format(i, "000")
If Mid(i, j, 1) = 1 Or Mid(i, j, 1) = 4 Or Mid(i, j, 1) = 7 Then a = a + 1
If Mid(i, j, 1) = 2 Or Mid(i, j, 1) = 5 Or Mid(i, j, 1) = 8 Then a = a + 10
Next j
If Mid(i, 1, 1) > Mid(i, 2, 1) Or Mid(i, 2, 1) > Mid(i, 3, 1) Then a 器村升两认须没磁倒交市= -1
Select Case a
Case 0: t1 = t1 & i & " "
Case 3: t2 = t2 & i & " "
Case 30: t3 = t3 & i & " "
Case 1: t4 = t4 & i & " "
Case 10: t5 = t5 & i & " "
Case 2: t6 = t6 & i & " "
Case 11: 领t7 = t7 & i & " "
Case 20: t8 = t8 & i & " "
Case 12: t9 = t9 & i & " "
Case 21: t10 = t10 & i & " "
End Select
Next i
Debug.Print t1 & vbCrLf & t2 & vbCrLf & t3 & vbCrLf & t4 & vbCrLf & t5 & vbCrLf & _
t5 & vbCrLf & t7 & vbCrLf & t8 & vbCrLf & t9 & vbCrLf & t10 & vbCrLf
End Sub
一周热门 更多>