从1,2,3,4,5,6这六个数字中,任取三个组成无重复数字的三位数,但当三个数字中有2和3时,2必须排在3

2024-12-12 20:21:33
推荐回答(2个)
回答1:

从1,2,3,4,5,6这六个数字中,任取三个组成无重复数字的三位数,共有

A
=6×5×4=120(个);
这三个数中有2与3,且3在2前边(与2在3前边情形相同)的有:
C
×
A
×
A
A
=12(个),
所以,满足题意的三位数有:120-12=108个.
故选:A.

回答2:

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