第1个好搞,第2个嘛.今天太晚了,等明天在看看吧,好象很麻烦......
@echo off
set/p a=开始数:
set/p b=步进数:
set/p c=结束数:
for /f "tokens=1,2 delims=S1" %%a in (list.txt)do set sr1=%%a&set sr2=%%b
for /l %%i in (%a% %b% %c%)do echo %sr1%%%i%sr2% >>lists.txt
第二个真长!!!代码如下:
@echo off&setlocal EnableDelayedExpansion
set/p a=开始数:
set/p b=步进数:
set/p c=结束数:
for /f "tokens=1,2 delims=S1" %%a in (list.txt)do set sr1=%%a&set sr2=%%b
for /l %%i in (%a% %b% %c%)do (
call:aa %%i
echo !sr1!!str!!sr2! >>lists.txt
)
start lists.txt
exit
::以下部分即是汉化!
:aa
set ma=%1
for /l %%i in (0 1 1000) do if "!ma:~%%i,1!"=="" set slen=%%i&goto :bb
:bb
set/a n=1&set m=!ma:~-1,1!&call:cc
if %slen% gtr 1 set/a n+=1&set "m=!ma:~-2,1!"&call:cc
if %slen% gtr 2 set/a n+=1&set "m=!ma:~-3,1!"&call:cc
if %slen% gtr 3 set/a n+=1&set "m=!ma:~-4,1!"&call:cc
if "%m3%%m2%%m1%"=="零零零" (
set m1=&set m2=&set m3=) else (
if "%m2%%m1%"=="零零" (
set m2=&set m1=) else (
if "%m3%%m2%"=="零零" (
set m2=) else if "%m1%"=="零" set m1=))
set "str=%m4%%m3%%m2%%m1%"
(set m1=<nul&set m2=<nul&set m3=<nul&set m4=<nul)
exit/b aa
:cc
if "!m:~-%n%,1!"=="0" set "m=零"
if "!m:~-%n%,1!"=="1" set "m=一"
if "!m:~-%n%,1!"=="2" set "m=二"
if "!m:~-%n%,1!"=="3" set "m=三"
if "!m:~-%n%,1!"=="4" set "m=四"
if "!m:~-%n%,1!"=="5" set "m=五"
if "!m:~-%n%,1!"=="6" set "m=六"
if "!m:~-%n%,1!"=="7" set "m=七"
if "!m:~-%n%,1!"=="8" set "m=八"
if "!m:~-%n%,1!"=="9" set "m=九"
if not defined m1 set m1=%m%&&exit/b cc
if not defined m2 (if "%m%"=="零" (set m2=%m%
) else (set m2=%m%十))&exit/b cc
if not defined m3 (if "%m%"=="零" (set m3=%m%
) else (set m3=%m%百))&exit/b cc
if not defined m4 (if "%m%"=="零" (set m4=%m%
) else (set m4=%m%千))
温馨提示:内容为网友见解,仅供参考