- @echo off
- setlocal enabledelayedexpansion
- for %%i in (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do (set /a var+=1) &(set %%i=!var!)
- set /p inputstr=inputword:
- :count
- if /i "!inputstr:~%jishu%,1!" neq "" (set /a count+=!inputstr:~%jishu%,1!)&(set /a jishu+=1) else (goto end)
- goto count
- :end
- echo !count!
- pause>nul
复制代码
|