- @echo off
- setlocal enabledelayedexpansion
- set /p str=请输入:
- for /l %%a in (0,1,10) do (
- if not "!str:~%%a,1!"=="" (
- echo !str:~%%a,1!|findstr "[a-zA-Z0-9]" && set /a "n=n+1" || set /a "m=m+1"
- )
- )
- if defined n set t=EN
- if defined m set t=CN
- if defined n if defined m set t=EC
- cls
- if not defined n set n=0
- if not defined m set m=0
- echo 英文 数量 :!n!
- echo 中文 数量 :!m!
- echo %t%
- endlocal
- pause
复制代码
|