本帖最后由 Demon 于 2011-5-31 20:16 编辑
第二题无法证明,“发 云 昆 巨 资 戚”这几个字不是重复了么?- @ECHO OFF
- SETLOCAL ENABLEDELAYEDEXPANSION
- FOR /F "delims=" %%i IN (千字文.txt) DO CALL :check %%i
- PAUSE & GOTO :EOF
-
- :check
- SET str=%*
- SET str=%str: =%
- :check_loop
- IF "%str%" NEQ "" (
- SET c=!str:~0,1!
- SET str=!str:~1!
- IF DEFINED dic[!c!] CALL ECHO %%dic[!c!]%% 重复
- SET dic[!c!]=!c!
- GOTO :check_loop
- )
- GOTO :EOF
复制代码
|