Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
14
Task/Nth/PowerShell/nth.psh
Normal file
14
Task/Nth/PowerShell/nth.psh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
function nth($inp){
|
||||
$suffix = "th"
|
||||
|
||||
switch($inp % 10){
|
||||
1{$suffix="st"}
|
||||
2{$suffix="nd"}
|
||||
3{$suffix="rd"}
|
||||
}
|
||||
return "$inp$suffix "
|
||||
}
|
||||
|
||||
0..25 | %{Write-host -nonewline (nth "$_")};""
|
||||
250..265 | %{Write-host -nonewline (nth "$_")};""
|
||||
1000..1025 | %{Write-host -nonewline (nth "$_")};""
|
||||
Loading…
Add table
Add a link
Reference in a new issue