tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Reverse-a-string/Batch-File/reverse-a-string.bat
Normal file
17
Task/Reverse-a-string/Batch-File/reverse-a-string.bat
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
call :reverse %1 res
|
||||
echo %res%
|
||||
goto :eof
|
||||
|
||||
:reverse
|
||||
set str=%~1
|
||||
set cnt=0
|
||||
:loop
|
||||
if "%str%" equ "" (
|
||||
goto :eof
|
||||
)
|
||||
set chr=!str:~0,1!
|
||||
set str=%str:~1%
|
||||
set %2=%chr%!%2!
|
||||
goto loop
|
||||
Loading…
Add table
Add a link
Reference in a new issue