@echo off&setlocal enabledelayedexpansion for /f "usebackq skip=35 delims=" %%a in ("%~dpnx0") do ( set "var=%%a" set "e=" set "m=0" set /a num+=1 call :is "%%a" ) for /l %%a in (1 1 %num%) do echo.!_str1%%a!!_num%%a!!_str2%%a! pause goto :eof :is set "str=%~1" if "%var:~-1%" lss "0" ( set "e=%var:~-1%!e!" set "var=%var:~0,-1%"&set /a m+=1 goto is ) set "_str2%num%=%e% set "_strn%num%=!str:~0,-%m%!" call :su "!_strn%num%!" goto :eof :su set "a=" set "u=%~1" set "y=0" :st for /l %%a in (0 1 9) do if "%u:~-1%"=="%%a" set "a=%u:~-1%!a!"&set /a y+=1 set "u=%u:~0,-1%" for /l %%a in (0 1 9) do if "%u:~-1%"=="%%a" goto :st set /a x+=1 set "_num%x%=%a%" set /a _num%num%*=7 set "_str1%x%=!_strn%x%:~0,-%y%!" goto :eof
@echo off&setlocal enabledelayedexpansion for /l %%i in (0 1 9) do set %%i=%%i for /f "delims=" %%i in (1.txt) do set "str=%%i"&call:lp pause&goto :eof :lp set/a n+=1 set var=!str:~-%n%,1! if defined !var! (set str2=!var!!str2!&set lp=lp) else ( if not defined lp (set str1=!var!!str1!) else ( set/a str2*=7&set str=!str:~,-%n%!!var!!str2!!str1! >>b.txt echo !str! for %%i in (str1 str2 n lp) do set %%i= goto :eof )) goto lp
youxi01:
复制代码 代码如下:
@echo off 2>nul 3>nul setlocal enabledelayedexpansion for /f "delims=" %%a in (list.txt) do ( set /a n=0 set var=%%a set var=!var:#= ! for %%i in (!var!) do set res=%%i Rem '/*处理浮点/// set /a ok=!res! && (set /a res=!res!*7) || (set var=!res:*.=! for /l %%i in (0 1 9) do set var=!var:%%i= %%i! for %%i in (!var!) do set/a n+=1 set res=!res:.=! set /a res=!res!*7 call set res=%%res:~0,-!n!%%.%%res:~-!n!%%) echo !res! )