Dim $man[5] = ["一夫", "二郎", "三吉", "四祥", "五平"]
Dim $career[5] = ["面包", "理发", "肉店", "烟酒", "职员"]
; $man[$man]=$man[$man]
$msg=$man[0] & " " & $man[1] & " " & $man[2] & " " & $man[3] & " " & $man[4] & @LF & @LF
For $career1=0 To 4
If check($career[$career1], "烟酒", "面包", "肉店") Then ContinueLoop
For $career2=0 To 4
If check($career[$career2],$career[$career1],"理发") Then ContinueLoop
For $career3=0 To 4
If check($career[$career3],$career[$career1],$career[$career2],"面包", "职员", "理发", "肉店") Then ContinueLoop
For $career4=0 To 4
If check($career[$career4],$career[$career3],$career[$career1],$career[$career2],"面包", "职员", "理发", "烟酒") Then ContinueLoop
For $career5=0 To 4
If check($career[$career5],$career[$career4],$career[$career3],$career[$career1],$career[$career2],"职员", "理发") Then ContinueLoop
$msg &= $career[$career1] & " " & $career[$career2] & " " & $career[$career3] & " " & $career[$career4] & " " & $career[$career5] & @LF
Next
Next
Next
Next
Next
MsgBox(0,"",$msg)
Func check( $v, $c1="1", $c2="", $c3="", $c4="", $c5="", $c6="", $c7="", $c8="", $c9="" )
For $i=1 To @NumParams-1
If $v=Eval("c"&$i) Then Return True
Next
Return False
EndFunc