Зашифровать текст (не более 255 символов), записывая все слова наоборот. Считать, что слова в тексте отделены друг от друга одним пробелом- Pascal(Паскаль)

var
s,s1,word,word1:string;
i:integer;
begin
readln(s);
s:=s+' ';
while pos(' ',s)>0 do begin
word:=copy(s,1,pos(' ',s));
for i:=length(word) downto 1 do
word1:=word1+word[i];;
s1:=s1+word1;
delete(s,1,pos(' ',s));
word1:='';
end;
if s1[1]=' ' then
delete(s1,1,1);
writeln(s1);
end.

Leave a Comment

7 + 2 =