Local $a = StringSplit("a,b,1,...",",")
$b = "3,2,1,0"
MsgBox(0,0,check($a, $b))
Func check($1, $2, $sign = ",")
If Not IsArray($1) Then $1 = StringSplit($1, $sign)
If Not IsArray($2) Then $2 = StringSplit($2, $sign)
Local $len = $1[0], $i, $boolean = True
If $2[0] < $len Then $len = $2[0]
For $i = 1 To $len
If $1[$i] == $2[$i] Then
$boolean = False
ExitLoop
EndIf
Next
Return $boolean
EndFunc
[au3]Local $calculator[2]= ['bitor', 'bitand']
Local $bool[5] =['1=1', '2<>2', '3=4', '4=4', '5<>5']
For $i In $calculator
For $j In $bool
For $k In $bool
If Execute($i & '(' & Execute($j) &','& Execute($k)&')') Then ConsoleWrite($i& '(' &$j & ',' & $k & ')'& @cr)
Next
Next
Next
[/au3]
简单了些,另外再给lz一个
[au3]For $i = 1 To 10
For $j =1 To 10
If Number(Execute('_add(' & $j &','&$i&')')) = 17 Then ConsoleWrite($j &','&$i& @cr)
Next
Next
Func _add($i, $j)
return $i + $j
EndFunc[/au3]
如何扩展lz自己想想吧
至于lz题目的要求,扩展运算符数组应该就行了
Dim $arr[2]=[2,3]
Dim $b[2]=[1,8]
$str=''
For $i=0 To UBound($arr)-1
$str&=$b[$i]&'>'&$arr[$i]&' and '
Next
$str=StringTrimRight($str,5)
ConsoleWrite($str&@CRLF)
If Execute($str) Then
MsgBox('','yes','true')
Else
MsgBox('','no','false')
EndIf
[au3]Local $aBool[5] = ['1=1', '2<>2', '3=4', '4=4', '5<>5']
Local $tempA = $aBool[0]
Local $tempB = $aBool[0]
For $j = 1 To 4
If Execute(Execute($tempA) & ' And ' & Execute($aBool[$j])) Then
$tempA &= ' and ' & $aBool[$j]
ConsoleWrite($tempA & @CR)
EndIf
If Execute(Execute($tempB) & ' Or ' & Execute($aBool[$j])) Then
$tempB &= ' Or ' & $aBool[$j]
ConsoleWrite($tempB & @CR)
EndIf
Next
[/au3]
lz再看看这段吧