- ::以下是问题2 代码2; 把第8行中的 9 19 删除就是代码1
- @echo off
- setlocal enabledelayedexpansion
- for /f "useback delims=" %%a in ("1.txt") do (
- set /a n+=1
- set m=%%a
- )
- (for %%a in (0 9 19) do (
- set /a l=n-m-%%a,k=0
- for /f "useback delims=" %%b in ("1.txt") do (
- set /a k+=1
- if !k! equ !l! echo %%b
- )
- ))>"2.txt"
- endlocal
- pause
复制代码
|