- @echo off
- setlocal enableDelayedExpansion
- set/a num=1,Max=1
- for /l %%i in (1 1 30) do set/a Max*=2
- :next
- set/a n=0,rst=1
- set/a "num<<=1"
- for /l %%i in (0 1 9) do set/a n+=!num:~%%i,1! 2>nul
- for /l %%i in (1 1 %n%) do set/a rst*=2
- if %num%==%rst% echo %num% 是这种数。
- if %num% lss %Max% goto :next
- pause
复制代码
|