编写一个函数,把普通数字转换为序数。对于零(0),只需以字符串的形式返回 "0"。
序数是描述某事物在列表中位置的数字。 本练习正是在这种语境下使用序数,并且采用英文拼写的序数名称。
序数包括(至少是其中一种形式):
1st 2nd 3rd 4th 5th... 9th 10th 11th 12th... 20th 21st 22nd 23rd 24th... etc.
因此,输入一个普通数字,就会得到与它对应的序数:
1 -> 1st
2 -> 2nd
3 -> 3rd
(and so on...)