- @echo off & setlocal Enabledelayedexpansion
- for /f "tokens=1,2 delims= " %%i in (a.xls) do (
- if not defined %%i ( set /a n+=1 & set "str[!n!]=%%i" )
- set /a %%i+=%%j , _%%i+=1
- )
- set "max=0" , "maxindex="
- echo 星期 天数(天) 参观人数(人) 日圴参观人数(人/天)>b.xls
- for /l %%i in (2,1,%n%) do (
- call set /a day=%%_!str[%%i]!%% , people=%%!str[%%i]!%%
- set /a average=people/day , days+=day , peoples+=people
- if !average! gtr !max! ( set /a max=average , maxindex=%%i )
- echo !str[%%i]! !day! !people! !average!>>b.xls
- )
- echo 合计 %days% %peoples% 据统计星期!str[%maxindex%]!为游客最多日>>b.xls
- exit
复制代码
|