Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Nth/Draco/nth.draco
Normal file
32
Task/Nth/Draco/nth.draco
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
proc nonrec nth(word n; *char buf) *char:
|
||||
channel output text ch;
|
||||
open(ch, buf);
|
||||
write(ch; n,
|
||||
if (n/10)%10=1 then "th"
|
||||
elif n%10=1 then "st"
|
||||
elif n%10=2 then "nd"
|
||||
elif n%10=3 then "rd"
|
||||
else "th"
|
||||
fi
|
||||
);
|
||||
close(ch);
|
||||
buf
|
||||
corp;
|
||||
|
||||
proc nonrec print_range(word start, stop) void:
|
||||
[8] char buf;
|
||||
word col, n;
|
||||
col := 0;
|
||||
for n from start upto stop do
|
||||
write(nth(n, &buf[0]));
|
||||
col := col + 1;
|
||||
if col%10=0 then writeln() else write('\t') fi
|
||||
od;
|
||||
writeln()
|
||||
corp
|
||||
|
||||
proc nonrec main() void:
|
||||
print_range(0, 25);
|
||||
print_range(250, 265);
|
||||
print_range(1000, 1025)
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue