本帖最后由 尘丶 于 2015-9-19 15:54 编辑
好了 你再自己修改下就可以了- @echo off & setlocal enabledelayedexpansion
- set s=101,102,339,340,341,342,343,592,593,594,595
- set n=1
- for %%a in (%s%) do (
- if !n!==1 (
- set k=%%a&set /a n+=1
- ) else (
- if %%a==!j! (
- set k=!k!-%%a
- ) else (
- set k=!k!,%%a
- )
- )
- set /a j=%%a+1
- )
- for %%a in (!k!) do (
- set l=%%a
- set /p=!l:~,4!!l:~-3!,<nul
- )
- pause
复制代码
|