tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
9
Task/Reverse-a-string/Pascal/reverse-a-string-1.pascal
Normal file
9
Task/Reverse-a-string/Pascal/reverse-a-string-1.pascal
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ the result array must be at least as large as the original array }
|
||||
procedure reverse(s: array[min .. max: integer] of char, var result: array[min1 .. max1: integer] of char);
|
||||
var
|
||||
i, len: integer;
|
||||
begin
|
||||
len := max-min+1;
|
||||
for i := 0 to len-1 do
|
||||
result[min1 + len-1 - i] := s[min + i]
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue