RosettaCodeData/Task/Reverse-a-string/Seed7/reverse-a-string-1.seed7

18 lines
353 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
$ include "seed7_05.s7i";
2024-03-06 22:25:12 -08:00
const func string: reverso(in string: stri) is func
2023-07-01 11:58:00 -04:00
result
var string: result is "";
local
var integer: index is 0;
begin
for index range length(stri) downto 1 do
result &:= stri[index];
end for;
end func;
const proc: main is func
begin
2024-03-06 22:25:12 -08:00
writeln(reverso("Was it a cat I saw"));
2023-07-01 11:58:00 -04:00
end func;