返回列表 发帖
本帖最后由 smatenchen 于 2022-11-13 10:12 编辑

回复 12# qixiaobin0715 terse BAT221110 hfxiang idwma Batcher
@echo off
(for /f "delims=" %%i in (1.txt) do (
    if "%%i"=="[333]" set n=
    if not defined n echo,%%i
    if "%%i"=="[222]" set n=true
))>temp.log
move temp.log 1.txtCOPY



if "%%~a"=="[333]" set /a b=1
if !b! EQU 1 echo;%%a
if "%%~a"=="[222]" set /a b=0COPY



1,
非常感谢!


2,
大神 qixiaobin0715 参考了第8楼大神 hfxiang 的解法,修改后写出的解法,
已知是最轻巧无bug的解法,了不起。


qixiaobin0715 和 hfxiang,两位大神,都非常了不起,尤其是大神 hfxiang,
没有 hfxiang 的珠玉解法在前,这道题难解得很。


大神 hfxiang,具有突破性创新思维,是难得的英才,实在是了不起。


3,
感谢大神们的帮忙!我再去调整组合一下,我的题就有解法了。
非常感谢!

TOP

本帖最后由 smatenchen 于 2022-11-13 09:31 编辑

回复 31# qixiaobin0715 terse BAT221110 hfxiang idwma Batcher
@echo off
(for /f "delims=" %%i in (1.txt) do (
    if "%%i"=="[333]" set n=
    if not defined n echo,%%i
    if "%%i"=="[222]" set n=true
))>temp.log
move temp.log 1.txt
   COPY
  
if "%%~a"=="[333]" set /a b=1
if !b! EQU 1 echo;%%a
if "%%~a"=="[222]" set /a b=0COPY


1,
非常感谢!


2,
哦!好主意!
那是,插入代码功能。


有需要时,的确是应该使用它的,以方便复制代码。


3,
感谢大神们帮忙!
非常感谢!

TOP

返回列表