CODE: [Copy to clipboard]
For i = 1 To 100-6*5
If instr(i,"6")<>0 then j=j & i & ";"
Next
j=left(j,len(j)-1):s=split(j,";"):m=ubound(s)
for a=0 to m
for b=a to m
for c=b to m
for d=c to m
for e=d to m
for f=e to m
s(a)=cint(s(a)):s(b)=cint(s(b)):s(c)=cint(s(c)):s(d)=cint(s(d)):s(e)=cint(s(e)):s(f)=cint(s(f))
If s(a) + s(b) + s(c) + s(d) + s(e) + s(f) = 100 Then sn=sn & s(a) & "+" & s(b) & "+" & s(c) & "+" & s(d) & "+" & s(e) & "+" & s(f) & " = 100" & vbcrlf
next
next
next
next
next
next
msgbox sn
CODE: [Copy to clipboard]
@echo off
setlocal enabledelayedexpansion
echo 正在处理数据...
echo.
echo 此过程超级慢,CPU占用将高达100%%,请吃顿饭再回来^^_^^
echo.
set begin=%time%
:: 提取数字
for /l %%i in (1,1,5) do set str=!str! %%i6
for /l %%i in (0,1,9) do set str=!str! 6%%i
set str=6 %str%
for %%i in (%str%) do (
for %%j in (%str%) do (
for %%k in (%str%) do (
for %%l in (%str%) do (
for %%m in (%str%) do (
for %%n in (%str%) do (
set expression=%%i+%%j+%%k+%%l+%%m+%%n
set /a sum=!expression!
if !sum! equ 100 set /a num+=1&echo 第!num!条记录:!expression!=100 时间:!time!
)
)
)
)
)
)
echo.
echo 终于完了,快看看花费的时间吧,破记录了吗?^^_^^
echo.
echo 开始时间:%begin%
echo 结束时间:%time%
pause