编一个简单的奥运倒计时bat程序

来源:百度知道 编辑:UC知道 时间:2024/06/19 11:27:40
运行后显示

今天
据北京奥运会 还有 xx天

@echo off&color ac&mode con cols=50 lines=10
title 这是我们每一个中国人的心声!!!
echo.&echo.&echo.
echo 打倒一切阻挠奥运的反动势力,全力支持奥运!
echo.
for /l %%i in (1,1,100) do call,set cls=%%cls%%
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
set /a number+=100%var:~3,2%%%100
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
set /a hm=100-1000%time:~9,2%%%1000,m=60-100%time:~6,2%%%100,f=60-100%time:~3,2%%%100,s=43-%time:~,2%
if %hm% equ 100 set /a hm-=100,m+=1
if %m% equ 60 set /a m-=60,f+=1
if %f% equ 60 set /a f-=60,h+=1
if %s% geq 24 set /a s-=24,day+=1
set /p= 离北京奥运开幕还有%day%天%s%小时%f%分%m%秒%hm%毫秒<nul
set /p=%cls%<nul
set n=0&set number=0
goto begin