『第
4 楼』:
可以研究一下别人写的
@echo off&color ac&mode con cols=50 lines=10
title 奥运倒计时--made by zw19750516(cn-dos)
goto one
:two
set n=2&set var=08-07&goto begin
:one
set n=1&set var=%date:~5,-4%
:begin
set month=%var:~1,1%&set number=29
set /a month-=1
for /l %%i in (1,1,%month%) do call :lp %%i
if %var:~3,1% equ 0 (set /a number+=%var:~4,1%) else (set /a number+=%var:~3,2%)
set str=%str% %number%
if not %n% equ 2 goto two
for /f "tokens=1,2" %%i in ("%str%") do set /a day=%%j-%%i
if %time:~6,1% equ 0 (set /a m=60-%time:~7,1%) else (set /a m=60-%time:~6,2%)
if %time:~3,1% equ 0 (set /a f=60-%time:~4,1%) else (set /a f=60-%time:~3,2%)
if %time:~,1% equ 0 (set /a s=44-%time:~1,1%) else (set /a s=44-%time:~,2%)
if %m% equ 60 set /a m-=60&set /a f+=1
if %f% equ 60 set /a f-=60&set /a h+=1
if %s% geq 24 set /a s-=24&set /a day+=1
cls
echo.&echo.&echo.
echo 现在离北京奥运开幕还有%day%天%s%小时%f%分%m%秒
echo.
echo 我们每个中国人都在期盼这一自豪时刻的到来!
set n=0&set number=0
ping /n 127.1>nul&goto :begin
:lp
for %%i in (1,3,5,7,8,10) do if %%i equ %1 set /a number+=31
for %%i in (4,6,9,11) do if %%i equ %1 set /a number+=30
goto :eof
@echo off&color ac&mode con cols=50 lines=10
title 奥运倒计时
for /l %%a in (1 1 100) do call set "t=%%t%%"
for /f "tokens=1-3 delims=./- " %%a in ("%date%") do (
set /a sy=%%a,sm=100%%b%%100,sd=100%%c%%100
)
for /l %%i in (%sm% 1 8) do call :loop %%i
set /a mt-=sd
for /f "tokens=1-3 delims=.: " %%a in ("%time%") do (
set /a ss=20-100%%a%%100-1,ff=60-100%%b%%100,mm=60-100%%c%%100
)
echo.&echo.
echo 我们每个中国人都在期盼着这一自豪时刻的到来!
echo.&echo.&echo.
set var=%time:~7,1%
:lis
if %mm% equ 0 set /a ff-=1,mm=59
if %ff% equ 0 set /a ss-=1,ff=59
if %ss% lss 0 set /a ss=%ss:~-1%,mt-=1
if %ss% equ 0 set /a ss=23,mt-=1
set /p= 离北京奥运开幕还有%mt%天%ss%小时%ff%分%mm:~-2%秒%time:~9%毫秒<nul
set /p=%t%<nul
set num=%time:~7,1%
if %var% neq %num% (set/a mm-=1&set var=%time:~7,1%)
goto lis
:loop
for /f "tokens=%~1" %%a in ("31 29 31 30 31 30 31 8") do set /a mt+=%%a
goto :eof
|