本帖最后由 Duvet 于 2011-12-9 18:41 编辑
回复 20# happytc
確實差很多,悠久的語言能廣乏流傳至今,是有存在的價值啊!
Main()
Exit
Func IsCombined($a, $b, $c)
If (Stringlen($a) + Stringlen($b)) <> StringLen($c) Then Return SetError(0, 0, False)
If StringLen($c) = 0 Then Return SetError(0, 0, True)
If $a == "" Then Return SetError(0, 0, $b == $c)
If $b == "" Then Return SetError(0, 0, $a == $c)
If StringLeft($a, 1) == StringLeft($c, 1) Then
If IsCombined(StringTrimLeft($a, 1), $b, StringTrimLeft($c, 1)) Then Return SetError(0, 0, True)
EndIf
If StringLeft($b, 1) == StringLeft($c, 1) Then
If IsCombined($a, StringTrimLeft($b, 1), StringTrimLeft($c, 1)) Then Return SetError(0, 0, True)
EndIf
Return SetError(0, 0, False)
EndFunc
Func Main()
Local $x = "black"
Local $y = "board"
Local $z1 = "blackboard"
Local $z2 = "boblaarcdk"
Local $z3 = "boabdrlack"
MsgBox(0, 0, IsCombined($x, $y, $z1) & @CRLF & IsCombined($x, $y, $z2) & @CRLF & IsCombined($x, $y, $z3));
EndFunc
|