本帖最后由 batman 于 2011-4-23 01:38 编辑
接着测试(又是一次头大的等待)
代码:- @echo off&setlocal enabledelayedexpansion
- for /l %%a in (1,1,10000) do set /a "_%%a=1"
- for /l %%a in (1,1,9) do (
- set "num="
- for /l %%b in (1,1,4) do (
- set "num=!num!%%a"
- for %%a in (!num!) do (
- set "t=!time!"
- for /l %%b in (1,1,10000) do set /a _%%a+=1
- set "t1=!time!"&set "a="
- if "!t:~,2!" lss "!t1:~,2!" set "a=+24"
- set /a ".%%a=(!t1:~,2!-!t:~,2!!a!)*360000+(1!t1:~3,2!%%100-1!t:~3,2!%%100)*6000+(1!t1:~6,2!%%100-1!t:~6,2!%%100)*100+(1!t1:~-2!%%100-1!t:~-2!%%100)"
- )
- )
- )
- set .
- pause>nul
复制代码 运行结果:- .1=393
- .11=440
- .111=409
- .1111=411
- .2=525
- .22=559
- .222=566
- .2222=562
- .3=657
- .33=711
- .333=717
- .3333=722
- .4=796
- .44=866
- .444=877
- .4444=876
- .5=928
- .55=1019
- .555=1036
- .5555=1028
- .6=1065
- .66=1166
- .666=1181
- .6666=1183
- .7=1191
- .77=1317
- .777=1336
- .7777=1342
- .8=1353
- .88=1483
- .888=1490
- .8888=1507
- .9=1476
- .99=1633
- .999=1655
- .9999=1656
复制代码
|