- @echo off
- setlocal enabledelayedexpansion
- ::一类 8888
- ::二类 x888 aaaa abcd 补充:888x
- ::三类 xx88 xaaa xabc aabb abab 补充:88xx, aaax
- ::四类 xxx8 xxaa abba 补充: 8xxx, aaxx
- ::五类 其余的号码
-
- :: 思路.
- :: 好吧这思路很乱.自己也写乱了.
- ::整体的思路是利用set /a 用数除0 然后判断各类的特点分类.
-
- set a_b=123456789
- set c_b=987654
- set b_a=543210
- ::连续的思路是利用set /a,替换字符将其他字符乘以0, 如%%i=123 , set /a "1/(!a_b:%%i=1*0*1!)"
- ::思路是可以用的..不过没有时间处理了..有时间的朋友帮我补充完整吧.
- for /l %%i in (9999, -1, 1) do (
- set /a "1 / ( %%i - 8888 )" 2>nul && (
- set /a "1/(%%i%%1000-888), 1/(%%i/10-888), 1/(%%i%%1111)" 2>nul && (
- set /a "a=%%i/1000, b=%%i%%1000/100, c=%%i%%100/10, d=%%i%%10"
- set /a "1/(%%i%%100-88), 1/(%%i/100-88),1/((%%i%%1000)%%111), 1/(%%i/100-%%i%%100), 1/((a-b)|(c-d))" 2>nul && (
- set /a "1/(%%i%%10-8), 1/(%%i/1000-8), 1/((%%i%%100)%%11), 1/(a*10+b-(d*10+c))" 2>nul&&(
- set /a ClassFive+=1!第五类!
- )|| (set /a ClassFour+=1!第四类! )
- ) || (set /a ClassThree+=1 & set _ClassThree=%%i !_ClassThree!!第三类!)
- ) || (if %%i gtr 1000 set /a ClassTwo+=1 & set _ClassTwo=%%i !_ClassTwo!!第二类!)
- ) || (set /a ClassOne+=1 & set _ClassOne=%%i !_ClassOne!!第一类!)
- )
- echo ClassOne=%ClassOne%, ClassTwo=%ClassTwo%, ClassThree=%ClassThree%, ClassFour=%ClassFour%, ClassFive=%ClassFive%
- pause>nul
- goto :eof
复制代码
|