返回列表 发帖
本帖最后由 tmplinshi 于 2013-2-2 22:54 编辑
@echo off
setlocal
for /f "delims=" %%a in (' findstr /n .* a.txt ') do (
    set str=%%a
    setlocal enabledelayedexpansion
    echo,!str:*:=!
   
    if "!str:&=!" neq "!str!" (
        endlocal
        set /a "count += 1, 1 / (count - 8)" 2>nul || goto finish
    ) else (
        endlocal
    )
)
:finish
echo 完成
pauseCOPY
1

评分人数

    • batman: 我就没想到这个分别endlocal的方法PB + 25

TOP

@echo off
setlocal enabledelayedexpansion
set count=0
(
    for /f %%a in (' findstr /n .* a.txt ') do (
        set str=
        set /p str=
        echo,!str!
        
        set str=#!str!
        if "!str:&=!" neq "!str!" (
            set /a "count += 1, 1 / (count - 8)" 2>nul || goto finish
        )
    )
) <a.txt
:finish
echo 完成
pauseCOPY

TOP

返回列表