It's almost New Year, little brother presents the calendar. If there are better, more convenient and simpler methods, please discuss.
There are any improper places in the code, everyone is welcome to criticize............
Wish: Happy New Year, all the best. Good luck in everything in the Year of the Pig!!
[ Last edited by huzixuan on 2007-2-21 at 10:49 PM ]
There are any improper places in the code, everyone is welcome to criticize............
Wish: Happy New Year, all the best. Good luck in everything in the Year of the Pig!!
@echo off
mode con: lines=12 cols=40
setlocal enabledelayedexpansion
for %%a in (一,二,三,四,五,六,日) do (
set /a a+=1
set j!a!=%%a)
for %%b in (31,28,31,30,31,30,31,31,30,31,30,31) do (
set /a y+=1
set s!y!=%%b)
set /p m=Which month to check?
cls
set n=%m%
set /a n-=1
for /l %%c in (1,1,%n%) do (
set /a day+=!s%%c!)
set b=0
for /l %%d in (1,1,!day!) do (
set /a b+=1
if !b! equ 8 set b=1)
if %m% equ 1 set b=7
echo 一 二 三 四 五 六 日
echo.
set flag= 一二三四五六日一二三四五六日
for /l %%f in (1 1 13) do (
if "!flag:~%%f,1!"=="!j%b%!" (
if "!j%%f!"=="一" (set /p s= <nul&set zh=6&goto next)
if "!j%%f!"=="二" (set /p s= <nul&set zh=5&goto next)
if "!j%%f!"=="三" (set /p s= <nul&set zh=4&goto next)
if "!j%%f!"=="四" (set /p s= <nul&set zh=3&goto next)
if "!j%%f!"=="五" (set /p s= <nul&set zh=2&goto next)
if "!j%%f!"=="六" (set /p s= <nul&set zh=1&goto next)
if "!j%%f!"=="日" (set /p s=<nul&set zh=7&goto next)
))
:next
for /l %%e in (1 1 !s%m%!) do (
set /a b+=1
if !b! equ 8 set b=1
if %%e lss 10 (set /p= %%e<nul) else (set /p= %%e<nul)
if !fl!==0 (set /a z+=1)
if !z!==7 (echo.&set z=0)
if %%e==!zh! (echo.
set fl=0
)
)
pause>nul
[ Last edited by huzixuan on 2007-2-21 at 10:49 PM ]
Recent Ratings for This Post
( 4 in total)
Click for details
江湖远
碧空长
路茫茫
一个人漫无目的的奔跑,风,刺骨的冷....
碧空长
路茫茫
一个人漫无目的的奔跑,风,刺骨的冷....
