回复 5# xudaweb
2楼的这样改:- @echo off & setlocal ENABLEDELAYEDEXPANSION
- (for /f %%i in (1.txt) do (
- set /a n+=1
- set /a a=!n!%%10
- if "!a!"=="0" (echo.) else (set /p=%%i <nul)
- ))>2.txt
- pause
复制代码 3楼的这样改:- @echo off
- (for /f "delims=" %%a in (1.txt) do (
- set /p=%%a <nul
- set /a "n+=1, 1/(n%%10)" 2>nul || echo,
- ))>2.txt
- pause
复制代码
|