langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
6
Task/Leap-year/UNIX-Shell/leap-year-1.sh
Normal file
6
Task/Leap-year/UNIX-Shell/leap-year-1.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
leap() {
|
||||
if expr $1 % 4 >/dev/null; then return 1; fi
|
||||
if expr $1 % 100 >/dev/null; then return 0; fi
|
||||
if expr $1 % 400 >/dev/null; then return 1; fi
|
||||
return 0;
|
||||
}
|
||||
3
Task/Leap-year/UNIX-Shell/leap-year-2.sh
Normal file
3
Task/Leap-year/UNIX-Shell/leap-year-2.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
leap() {
|
||||
date -d "$1-02-29" >/dev/null 2>&1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue