Evo ti u delphi-ju. Trebalo bi da je isto i u paskalu (ne mogu da se setim dal ima copy ili nesto drugo).
Code:
function Obrni(S: String): String;
var R,Res: String;
Poz,I: Integer;
begin
Res:='';
while s<>'' do
begin
Poz :=pos(' ',S);
if Poz = 0 then
Poz := Length(S)+1;
R:= copy(S,1,Poz-1);
S:= copy(S,Poz+1,255);
for I:= Length(R) downto 1 do
Res := Res + copy(R,i,1);
if S<>'' then
Res := Res+' ';
end;
Obrni := Res;
end;