Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

36
Task/Nth/XPL0/nth.xpl0 Normal file
View file

@ -0,0 +1,36 @@
\N'th
code Rem=2, CrLf=9, IntIn=10, IntOut=11, Text=12;
procedure Suf(N, S);
integer N;
character S;
integer NMod10, NMod100;
begin
NMod10:= Rem(N/10);
NMod100:= Rem(N/100);
case of
NMod10 = 1 & NMod100 # 11: S(0):= "st";
NMod10 = 2 & NMod100 # 12: S(0):= "nd";
NMod10 = 3 & NMod100 # 13: S(0):= "rd"
other
S(0):= "th";
end;
procedure PrintImages(LoLim, HiLim);
integer LoLim, HiLim;
integer I;
character S;
begin
for I:= LoLim, HiLim do
begin
Suf(I, addr S);
IntOut(0, I); Text(0, S); Text(0, " ")
end;
CrLf(0)
end;
begin
PrintImages(0, 25);
PrintImages(250, 265);
PrintImages(1000, 1025)
end