N'th: Difference between revisions

625 bytes added ,  3 years ago
(→‎{{header|UNIX Shell}}: Add implementation)
Line 3,289:
esac
printf '%d%s\n' "$n" "${ordinals[i]}"
}
}</lang>
for n in {0..25} {250..265} {1000..1025}; do
nth $n
done | column</lang>
 
{{Out}}
<pre>0th 7th 14th 21st 252nd 259th 1000th 1007th 1014th 1021st
1st 8th 15th 22nd 253rd 260th 1001st 1008th 1015th 1022nd
2nd 9th 16th 23rd 254th 261st 1002nd 1009th 1016th 1023rd
3rd 10th 17th 24th 255th 262nd 1003rd 1010th 1017th 1024th
4th 11th 18th 25th 256th 263rd 1004th 1011th 1018th 1025th
5th 12th 19th 250th 257th 264th 1005th 1012th 1019th
6th 13th 20th 251st 258th 265th 1006th 1013th 1020th</pre>
 
=={{header|VBA}}==
1,480

edits