Hehe, didn't expect that number sorting actually caused the second storm in the union. It's lively.
Also post a piece of previous code to add some fun
:
Also post a piece of previous code to add some fun
:
@echo off&goto start&rem 数字排序
Numbers are in a.txt, one per line
Can sort any integer within 200 digits. (Including negative numbers, positive numbers, 0, and repeated numbers)
Disadvantage: For numbers starting with 0, the leading 0 will be ignored in the result
::by 26933062 2007-11-25
:start
setlocal EnableDelayedExpansion
for /l %%a in (1 1 200) do set lin=0!lin!
for /f %%a in (a.txt) do (
set "str=%%a"
if "!str:~0,1!"=="-" (set fus=a&set str=!str:~1!&set zf=_) else set zf=+
set str=!lin!!str!
set !zf!!str:~-200! !random!!random!!random!!random!!random!!random!!random!=a
)
if defined fus call :sort _ /r
call :sort +
pause&exit
:sort
for /f "tokens=1,2 delims=_+= " %%a in ('set %1^|sort %2') do (
for /f "tokens=* delims=0" %%i in ("%%a") do (
if "%1"=="_" (set fuhao=-) else set "fuhao="
if "%%i"=="" (echo !fuhao!0) else echo !fuhao!%%i
)
)
goto :eof
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| plp626 | +7 | 2008-05-04 22:01 |
致精致简!

DigestI
