从1,2,3,4,5,6这六个数字中,任取三个组成无重复数字的三位数,但当三个数字中有2和3时,2必须排在3
从1,2,3,4,5,6这六个数字中,任取三个组成无重复数字的三位数,但当三个数字中有2和3时,2必须排在3前面(不一定相邻),这样的三位数有()A.108个B.102个...
从1,2,3,4,5,6这六个数字中,任取三个组成无重复数字的三位数,但当三个数字中有2和3时,2必须排在3前面(不一定相邻),这样的三位数有( )A.108个B.102个C.98个D.96个
展开
展开全部
Dim pp As Integer
Dim pp_Num As String
Dim i As Integer, x As Integer, y As Integer, z As Integer
For x = 1 To 6
For y = 1 To 6
For z = 1 To 6
If x <> y Then
If y <> z Then
If x <> z Then
i = 100 * x + 10 * y + z
If i Mod 6 = 0 Then
pp = pp + 1
pp_Num = pp_Num & "," & i
End If
i = 0
End If
End If
End If
Next z, y, x
Debug.Print pp, pp_Num
共24个: 126,132,156,162,216,234,246,264,312,324,342,354,426,432,456,462,516,534,546,564,612,624,642,654
Dim pp_Num As String
Dim i As Integer, x As Integer, y As Integer, z As Integer
For x = 1 To 6
For y = 1 To 6
For z = 1 To 6
If x <> y Then
If y <> z Then
If x <> z Then
i = 100 * x + 10 * y + z
If i Mod 6 = 0 Then
pp = pp + 1
pp_Num = pp_Num & "," & i
End If
i = 0
End If
End If
End If
Next z, y, x
Debug.Print pp, pp_Num
共24个: 126,132,156,162,216,234,246,264,312,324,342,354,426,432,456,462,516,534,546,564,612,624,642,654
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询