返回列表 发帖
这个不是应该放到新手练习区么

TOP

@echo off
set "n0=0 "
set "n1=1 "
set "n2=2 "
set "n3=3 "
set "n4=4 "
set "n5=5 "
set "n6=6 "
set "n7=7 "
set "n8=8 "
set "n9=9 "
for /f "delims=" %%a in (1.txt) do (
for %%b in (%%a) do (
setlocal ENABLEDELAYEDEXPANSION
set num=%%b
set re=n!num:~-1!
call set "!re!=!!re!! %%b"
ENDLOCAL
)
)
echo %n0%
echo %n1%
echo %n2%
echo %n3%
echo !n4!
echo !n5!
echo !n6!
echo !n7!
echo !n8!
echo !n9!COPY
问下这个为什么不行  变量嵌套的还是用不好

TOP

@echo off
setlocal ENABLEDELAYEDEXPANSION
for /l %%i in (0,1,9) do set "n%%i=%%i"
for /f "delims=" %%a in (1.txt) do (
for %%b in (%%a) do (
set num=%%b
set re=n!num:~-1!
call set "!re!=%%!re!%% %%b"
)
)
for /l %%p in (0,1,9) do call echo %%n%%p%%
pause
goto :eofCOPY
好了  今天来给我昨天那个稍微改了下  可以了  HOHO
1

评分人数

TOP

@echo off
setlocal ENABLEDELAYEDEXPANSION
md l100
md g100
for /l %%i in (0,1,9) do set "n%%i=%%i"
for /f "delims=" %%a in (1.txt) do (
for %%b in (%%a) do (
if %%b lss 100 (echo off >l100/%%b) else (echo off >g100/%%b)
)
)
dir /o:n /b l100 >>result.txt
dir /o:n /b g100 >>result.txt
for /f %%m in (result.txt) do (
set num=%%m
set re=n!num:~-1!
call set "!re!=%%!re!%% %%m"
)
for /l %%p in (0,1,9) do call echo %%n%%p%%
rd /s /q l100
rd /s /q g100
del result.txt
pause
goto :eofCOPY
昨天没看到有排序的要求  HOHO  现在写好了   新手   给点鼓励

TOP

返回列表