Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Reverse-a-string/Modula-3/reverse-a-string.mod3
Normal file
16
Task/Reverse-a-string/Modula-3/reverse-a-string.mod3
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
MODULE Reverse EXPORTS Main;
|
||||
|
||||
IMPORT IO, Text;
|
||||
|
||||
PROCEDURE String(item: TEXT): TEXT =
|
||||
VAR result: TEXT := "";
|
||||
BEGIN
|
||||
FOR i := Text.Length(item) - 1 TO 0 BY - 1 DO
|
||||
result := Text.Cat(result, Text.FromChar(Text.GetChar(item, i)));
|
||||
END;
|
||||
RETURN result;
|
||||
END String;
|
||||
|
||||
BEGIN
|
||||
IO.Put(String("Foobarbaz") & "\n");
|
||||
END Reverse.
|
||||
Loading…
Add table
Add a link
Reference in a new issue