2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
17
Task/Nth/PowerShell/nth-2.psh
Normal file
17
Task/Nth/PowerShell/nth-2.psh
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
function Get-Nth ([int]$Number)
|
||||
{
|
||||
$suffix = "th"
|
||||
|
||||
switch ($Number % 10)
|
||||
{
|
||||
1 {$suffix = "st"}
|
||||
2 {$suffix = "nd"}
|
||||
3 {$suffix = "rd"}
|
||||
}
|
||||
|
||||
"$Number$suffix"
|
||||
}
|
||||
|
||||
1..25 | ForEach-Object {Get-Nth $_} | Format-Wide {$_} -Column 5 -Force
|
||||
251..265 | ForEach-Object {Get-Nth $_} | Format-Wide {$_} -Column 5 -Force
|
||||
1001..1025 | ForEach-Object {Get-Nth $_} | Format-Wide {$_} -Column 5 -Force
|
||||
Loading…
Add table
Add a link
Reference in a new issue