N'th: Difference between revisions

152 bytes added ,  11 months ago
→‎{{header|Batch File}}: Fixed 11tth, 12th and 13th
(→‎{{header|REXX}}: Refurbished and two alternate solutions added to the oiginal)
(→‎{{header|Batch File}}: Fixed 11tth, 12th and 13th)
Line 926:
setlocal enabledelayedexpansion
for /l %%n in (%~1,1,%~2) do (
set curr_num=%%n
set "out=%%nth"
if !curr_num:~-1!==1 (set "out=%%nst")
if !curr_num:~-1!==2 (set "out=%%nnd")
if !curr_num:~-1!==3 (set "out=%%nrd")
if !curr_num:~-2!==11 (set "out=%%nth")
set "range_output=!range_output! !out!"
if !curr_num:~-2!==12 (set "out=%%nth")
if !curr_num:~-2!==13 (set "out=%%nth")
set "range_output=!range_output! !out!"
)
echo."!range_output:~1!"
goto :EOF</syntaxhighlight>
{{Out}}
<pre>
<pre>"0th 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11st11th 12nd12th 13rd13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th"
"250th 251st 252nd 253rd 254th 255th 256th 257th 258th 259th 260th 261st 262nd 263rd 264th 265th"
"1000th 1001st 1002nd 1003rd 1004th 1005th 1006th 1007th 1008th 1009th 1010th 1011st1011th 1012nd1012th 1013rd1013th 1014th 1015th 1016th 1017th 1018th 1019th 1020th 1021st 1022nd 1023rd 1024th 1025th"
Press any key to continue . . .</pre>
</pre>
 
=={{header|BBC BASIC}}==
3,021

edits