凑热闹~- @echo Off & setlocal EnableDelayedExpansion
- set /a n = 1
- For /L %%a in (1 1 30) do (
- set /a n "<<" = 1, y=0, m=n
- Call :Recur %%a && (Echo 2 ^^^^ %%a = !n!& Pause & Exit /b)
- )
- :Recur
- If defined m (
- set /a y+=%m:~,1%
- set m=%m:~1%
- goto :Recur
- )
- If %y% equ %1 (exit /b 0) else (exit /b 1)
复制代码
- @echo off & setlocal enableDelayedExpansion
- set /a n= 1
- For /l %%a in (1 1 30) do (
- set /a n "<<" = 1, m=n
- For /l %%d in (0 1 9) do set "m=!m:%%d=%%d+!"
- set /a x=!m:~,-1!
- If !x! equ %%a echo 2 ^^^^ %%a = !n!
- )
- Pause
复制代码
[ 本帖最后由 pusofalse 于 2009-1-25 01:46 编辑 ] |