(求字符的逆序)下面的程序的功能是输入若干行字符串,每输入一行,就按逆序输出该行,最后键入-1终止程序。
请将程序补充完整。
Program j401;
type str1=string[100];
var line:str1; kz:integer;
procedure reverse(var s:str1);
var I,j:integer; t:char;
begin
i:=1; j:=length(s);
while (i<j) do begin
t:=s[i]; s[i]:=s[j]; s[j]:=t;
____inc(i)____;____dec(j)_____ ;
end;
end;
begin
writeln(‘continue? -1 for end.’);
readln(kz);
while ( ___kz<>-1_____)do
begin
readln(line);
___reverse(line)_____;
writeln(line);
writeln(‘continue? -1 for end.’);
readln(kz);
end;
end.
2 2 3 3
2 -1 1 3
4 1 1 5
4 4 5 5