Jump to content

N'th: Difference between revisions

19 bytes added ,  4 years ago
m
Line 752:
=={{header|Elena}}==
{{trans|C#}}
ELENA 45.10 :
<lang elena>import extensions;
import system'math;
Line 762:
{
int i := self.Absolute;
if (new int[]::({11,12,13)}.ifExists(i.mod:100))
{
^ i.PrintabletoPrintable() + "th"
};
(i.mod:(10)) =>
1 { ^ i.PrintabletoPrintable() + "st" }
2 { ^ i.PrintabletoPrintable() + "nd" }
3 { ^ i.PrintabletoPrintable() + "rd" };
^ i.PrintabletoPrintable() + "th"
}
}
Line 778:
public program()
{
console.printLine(new Range(0,26).selectBy(mssgconst ordinalize<op>[01]));
console.printLine(new Range(250,26).selectBy(mssgconst ordinalize<op>[01]));
console.printLine(new Range(1000,26).selectBy(mssgconst ordinalize<op>[01]))
}</lang>
{{out}}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.