Advertisement
31ph4n70m

reverse_string.pp

Nov 19th, 2019
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.37 KB | None | 0 0
  1. (* Pascal solution to codeabbey challenge 30 *)
  2. program reverse_string;
  3. var
  4.     t:string;
  5.  
  6. function revstr(my_s:string):string;
  7.     var out_s:string;
  8.     ls,i:integer;
  9.     begin
  10.     ls:=length(my_s);
  11.     for i:=1 to ls do
  12.     out_s:=out_s+my_s[ls-i+1];
  13.     revstr:=out_s;
  14.     end;
  15. begin  
  16.     t:=revstr('on fare supper off shelf jeopardy about cactus');
  17.     writeln(t);
  18. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement