Đưa ra xâu đảo theo từ
uses crt;
var s:string;
x,y,z,t:byte;
begin
write('Nhap vao mot xau: ');
readln(s);
z:=length(s);
for y:=length(s) downto 1 do
begin
if ((s[y]=' ')or(y=1)) then begin for t:=y to z do write(s[t]);z:=y end;
write(' ');
end;
readln;
end.
0 nhận xét:
Đăng nhận xét
Click to see the code!
To insert emoticon you must added at least one space before the code.