Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Reverse-a-string/Pascal/reverse-a-string-3.pas
Normal file
12
Task/Reverse-a-string/Pascal/reverse-a-string-3.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function reverse(s:string):string;
|
||||
var i:integer;
|
||||
var tmp:char;
|
||||
begin
|
||||
for i:=1 to length(s) div 2 do
|
||||
begin
|
||||
tmp:=s[i];
|
||||
s[i]:=s[length(s)+1-i];
|
||||
s[length(s)+1-i]:=tmp;
|
||||
reverse:=s;
|
||||
end;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue