leap.ksh
来自「Solaris环境下Shell编程编程」· KSH 代码 · 共 31 行
KSH
31 行
#!/bin/ksh# Script name: leap.ksh# Assume the user enters the year on the command line # when they execute the script.if [ $# != 1 ]then echo "You need to enter the year." exit 1fi year=$1if (( (year % 400) == 0 ))then print "$year is a leap year!"elif (( (year % 4) == 0 ))then if (( (year % 100) != 0 )) then print "$year is a leap year!" else print "$year is not a leap year." fielse print "$year is not a leap year."fi
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?