注:n为要运行的最后一条指令的数字,如最后一个为armmcc a10.c则n为10。
第一问:
@echo off
for /l %%i in (1,1,n) do call :lp %%i
pause>nul&goto :eof
:lp
armcc a%1.c>temp.txt
for /f "delims=" %%i in (temp.txt) do set str=%%i
echo %str%&del /q temp.txt
第二问:
@echo off
for /l %%i in (1,1,n) do call :lp %%i
echo the number for wrong is %num%
pause>nul&goto :eof
:lp
armcc a%1.c>temp.txt
for /f "tokens=2 delims= " %%i in (temp.txt) do set str=%%i
set /a num+=%str%&del /q temp.txt
第三问:
@echo off
for /l %%i in (1,1,n) do armcc a%%i.c>nul|findstr /c:"0 errors"||goto :eof
[
Last edited by zw19750516 on 2008-5-30 at 09:53 PM ]