
CODE: [Copy to clipboard]@echo off
set Output=
set /p Enter=请输入:
:Start
if not "%Enter%"=="" (
set Output=%Output%%Enter:~-1%
set Enter=%Enter:~0,-1%
goto :Start)
echo.
echo %Output%
pause >nul
CODE: [Copy to clipboard]如果分开做几个sub的话效率会搞一些.@echo off
set "a=123456789123456789"
call :sub -1 -1
echo %ret%
call :sub 0 2
echo %ret%
call :sub 1 2
echo %ret%
pause
goto :eof
:sub
set i=%1
set "str="
set "str1="
set "ret="
:loop
call set "str=%%a:~%i%,1%%"
if not defined str goto :eof
set /a j=i*-1-1
call set "str1=%%a:~%j%,1%%"
if not defined str1 goto :eof
set "ret=%ret%%str%"
set /a i+=%2
goto :loop
CODE: [Copy to clipboard]echo 123456789|sed "/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//"
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |