1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
@echo off&setlocal enabledelayedexpansion echo 位运算演示:a和b for %%i in (00 01 10 11) do ( set i=%%i set a=!i:~0,1! set b=!i:~-1! set /a c=a^&b echo !a!与!b!=!c! ) pause @echo off&setlocal enabledelayedexpansion echo 位运算演示:a或b for %%i in (00 01 10 11) do ( set i=%%i set a=!i:~0,1! set b=!i:~-1! set /a c=a^|b echo !a!或!b!=!c! ) pause @echo off&setlocal enabledelayedexpansion echo 位运算演示:a异或b for %%i in (00 01 10 11) do ( set i=%%i set a=!i:~0,1! set b=!i:~-1! set /a c=a^^b echo !a!异或!b!=!c! ) pause |
发表回复