@echo off
echo i love bathome.net
if exist 1.txt goto b
if not exist 1.txt goto a
:a
>1.txt echo 1
goto :eof
:b
set /p i=<1.txt&&>2.txt echo 1&&set /p o=<2.txt
set /a a=%i%+%o%
echo %a% >1.txt
type 1.txt&del 2.txt
pause
goto :eof
pause
引用:
echo i love bathome.net
:a
>1.txt echo 1
goto :eof
:b
set /p i=<1.txt&&>2.txt echo 1&&set /p o=<2.txt
set /a a=%i%+%o%
echo %a% >1.txt
type 1.txt&del 2.txt
pause
goto :eof
if exist 1.txt goto b
if not exist 1.txt goto a
pause
第一段代码能正常运行但第2段不行!
为什么!
蓝色的地方换了个位子就不能在1.txt文件里递加了!里面的内容一直是1
难道是运行了
:a标签后的 ?不过:a标签为什么可以运行?不是我用代码限制了吗?
if not exist 1.txt goto a