String s;
int x = a % 100;
if (x > 9 && x < 21) s = "th";
else s = switch (a % 10) {
case 1 -> "st";
case 2 -> "nd";
case 3 -> "rd";
default -> "th";
};
s = a + s;
if ((a mod 100) in [10..20]) then
s := 'th'
else
case (a mod 10) of
1: s := 'st';
2: s := 'nd';
3: s := 'rd';
otherwise
s := 'th';
end;
s := a.ToString + s;
String s;
int x = a % 100;
if (x > 9 && x < 21) s = "th";
else s = switch (a % 10) {
case 1 -> "st";
case 2 -> "nd";
case 3 -> "rd";
default -> "th";
};
s = a + s;
if ((a mod 100) in [10..20]) then
s := 'th'
else
case (a mod 10) of
1: s := 'st';
2: s := 'nd';
3: s := 'rd';
otherwise
s := 'th';
end;
s := a.ToString + s;