Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Nth/Tcl/nth.tcl
Normal file
15
Task/Nth/Tcl/nth.tcl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
proc ordinal {n} {
|
||||
if {$n%100<10 || $n%100>20} {
|
||||
set suff [lindex {th st nd rd th th th th th th} [expr {$n % 10}]]
|
||||
} else {
|
||||
set suff th
|
||||
}
|
||||
return "$n'$suff"
|
||||
}
|
||||
|
||||
foreach start {0 250 1000} {
|
||||
for {set n $start; set l {}} {$n<=$start+25} {incr n} {
|
||||
lappend l [ordinal $n]
|
||||
}
|
||||
puts $l
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue