Last active
March 31, 2021 07:35
-
-
Save xyuanmu/15305359d6d47021c8aeafa1ccc8155a to your computer and use it in GitHub Desktop.
批处理奇偶运行不同代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set n=0 | |
:run | |
set /a n+=1 | |
set /a x=!n! %% 2 | |
if "!x!"=="1" ( | |
echo.奇数 | |
) else ( | |
echo.偶数 | |
) | |
if %n%==18 ( | |
pause | |
) else ( | |
call :run | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment