呵呵,和LOVE5173兄思路相同
local $time=TimerInit()
Local $output
local $k=4
For $i=1234 to Int(8765/$k)
$num=$i*$k
If Not StringRegExp($i&$num,'(.)[^\1]*(\1|0|9)',0) Then
$output&=$i&"x4="&$num&@CRLF
EndIf
Next
MsgBox(0,TimerDiff($time),$output)
另一个方法也没有什么新意
local $time=TimerInit()
Local $output
local $k=4
For $i=1234 to Int(8765/$k)
$num=$i*$k
if StringRegExp($num,'0|9',0) Then ContinueLoop
If check($i,$num) Then
$output&=$i&"====>"&$num&@CRLF
EndIf
Next
MsgBox(0,TimerDiff($time),$output)
Func check($data1,$data2)
local $string='12345678'
$a=StringRegExpReplace($string,'['&$data2&']','')
$b=StringRegExpReplace($string,'['&StringRegExpReplace($string,'['&$data1&']','')&']','')
If $a=$b Then Return 1
EndFunc
|