N'th: Difference between revisions
Content added Content deleted
(Add Red) |
|||
Line 2,535: | Line 2,535: | ||
750'th 751'st 752'nd 753'rd 754'th 755'th 756'th 757'th 758'th 759'th 760'th 761'st 762'nd 763'rd 764'th 765'th 766'th 767'th 768'th 769'th 770'th 771'st 772'nd 773'rd 774'th |
750'th 751'st 752'nd 753'rd 754'th 755'th 756'th 757'th 758'th 759'th 760'th 761'st 762'nd 763'rd 764'th 765'th 766'th 767'th 768'th 769'th 770'th 771'st 772'nd 773'rd 774'th |
||
1000'th 1001'st 1002'nd 1003'rd 1004'th 1005'th 1006'th 1007'th 1008'th 1009'th 1010'th 1011'th 1012'th 1013'th 1014'th 1015'th 1016'th 1017'th 1018'th 1019'th 1020'th 1021'st 1022'nd 1023'rd 1024'th</pre> |
1000'th 1001'st 1002'nd 1003'rd 1004'th 1005'th 1006'th 1007'th 1008'th 1009'th 1010'th 1011'th 1012'th 1013'th 1014'th 1015'th 1016'th 1017'th 1018'th 1019'th 1020'th 1021'st 1022'nd 1023'rd 1024'th</pre> |
||
=={{header|Objeck}}== |
|||
{{trans|Java}} |
|||
<lang objeck>class Nth { |
|||
function : OrdinalAbbrev(n : Int ) ~ String { |
|||
ans := "th"; # most of the time it should be "th" |
|||
if(n % 100 / 10 = 1) { |
|||
return ans; # teens are all "th" |
|||
}; |
|||
select(n % 10){ |
|||
label 1: { ans := "st"; } |
|||
label 2: { ans := "nd"; } |
|||
label 3: { ans := "rd"; } |
|||
}; |
|||
return ans; |
|||
} |
|||
function : Main(args : String[]) ~ Nil { |
|||
for(i := 0; i <= 25; i+=1;) { |
|||
abbr := OrdinalAbbrev(i); |
|||
"{$i}{$abbr} "->Print(); |
|||
}; |
|||
""->PrintLine(); |
|||
for(i := 250; i <= 265; i+=1;) { |
|||
abbr := OrdinalAbbrev(i); |
|||
"{$i}{$abbr} "->Print(); |
|||
}; |
|||
""->PrintLine(); |
|||
for(i := 1000; i <= 1025; i+=1;) { |
|||
abbr := OrdinalAbbrev(i); |
|||
"{$i}{$abbr} "->Print(); |
|||
}; |
|||
} |
|||
}</lang> |
|||
{{output}} |
|||
<pre> |
|||
0th 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 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 1011th 1012th 1013th 1014th 1015th 1016th 1017th 1018th 1019th 1020th 1021st 1022nd 1023rd 1024th 1025th |
|||
</pre> |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |