happy886rr 当前离线
等待验证会员
TOP
sishentibu 当前离线
上等兵
@echo off set a=1000052 set /a b=a/1000 set /a c=a/1000000 if %b%==0 (echo %a%) else ( if %c%==0 (echo %a:~0,-3%,%a:~-3%) else (echo %a:~0,-6%,%a:~-6,3%,%a:~-3%))复制代码
WHY 当前离线
上校
@echo off & setlocal enabledelayedexpansion set "n=-1234567890" for /l %%i in (-18 3 -3) do set "n=!n:~0,%%i!,!n:~%%i!" for /f "tokens=*delims=," %%i in ("%n%") do set "n=%%i" echo;%n:-,=-% pause复制代码
@echo off setlocal enabledelayedexpansion set /p num=输入数字: :cut if "!num!"=="" ( set p1=!p1:-,^=-! echo !p1:~1! &pause>nul&exit ) set p1=,!num:~-3!!p1! set num=!num:~0,-3! goto cut复制代码
CrLf 当前离线
论坛巡查
@echo off setlocal enabledelayedexpansion for /f %%i in ("123465") do ( echo %%i set a=%%i echo !a:~0,2!) pause复制代码