2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
2
Task/Even-or-odd/PowerShell/even-or-odd-1.psh
Normal file
2
Task/Even-or-odd/PowerShell/even-or-odd-1.psh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$IsOdd = -not ( [bigint]$N ).IsEven
|
||||
$IsEven = ( [bigint]$N ).IsEven
|
||||
2
Task/Even-or-odd/PowerShell/even-or-odd-2.psh
Normal file
2
Task/Even-or-odd/PowerShell/even-or-odd-2.psh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$IsOdd = [boolean]( $N -band 1 )
|
||||
$IsEven = [boolean]( $N -band 0 )
|
||||
2
Task/Even-or-odd/PowerShell/even-or-odd-3.psh
Normal file
2
Task/Even-or-odd/PowerShell/even-or-odd-3.psh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$IsOdd = $N % 2 -ne 0
|
||||
$IsEven = $N % 2 -eq 0
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
function parity($n) {
|
||||
if($n%2 -eq 0) {
|
||||
"$n is even"
|
||||
} else {
|
||||
"$n is odd"
|
||||
}
|
||||
}
|
||||
parity 0
|
||||
parity 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue