Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

26
Task/Nth/PL-I/nth.pli Normal file
View file

@ -0,0 +1,26 @@
Nth: procedure options (main); /* 1 June 2014 */
declare i fixed (10);
do i = 0 to 25, 250 to 265, 1000 to 1025;
if i = 250 | i = 1000 then put skip (2);
put edit (enth(i)) (x(1), a);
end;
enth: procedure (i) returns (character (25) varying);
declare i fixed (10);
declare suffix character (2);
select (mod(i, 10));
when (1) suffix = 'st';
when (2) suffix = 'nd';
when (3) suffix = 'rd';
otherwise suffix = 'th';
end;
select (mod(i, 100));
when (11, 12, 13) suffix = 'th';
otherwise ;
end;
return ( trim(i) || suffix );
end enth;
end Nth;