- @echo off
- :start
- set /p a=Please input the year!:
- set /a x=%a%%%4
- set /a y=%a%%%100
- set /a z=%a%%%400
- if %z% equ 0 goto leap
- if %x% equ 0 (if %y% neq 0 goto leap else goto warning) else goto leap
- :warning
- echo The year you inputted is not leap year. Please input again!
- goto start
- :leap
- echo The year you inputted is leap year!
- pause
复制代码
[ 本帖最后由 Lumiere 于 2009-3-23 19:10 编辑 ] |