program ReplaceAndDelete;uses crt;varstr, newStr: string;i: integer;beginclrscr;
writeln('Enter a string: ');readln(str);
//Replace all 'И' with '%'newStr := str;for i := 1 to length(str) dobeginif str[i] = 'И' thennewStr[i] := '%';end;
writeln('String with all "И" replaced with "%": ', newStr);
//Delete all characters starting from the middle of the stringnewStr := '';for i := 1 to length(str) div 2 dobeginnewStr := newStr + str[i];end;
writeln('String with characters deleted from the middle: ', newStr);
end.
program ReplaceAndDelete;
uses crt;
var
str, newStr: string;
i: integer;
begin
clrscr;
writeln('Enter a string: ');
readln(str);
//Replace all 'И' with '%'
newStr := str;
for i := 1 to length(str) do
begin
if str[i] = 'И' then
newStr[i] := '%';
end;
writeln('String with all "И" replaced with "%": ', newStr);
//Delete all characters starting from the middle of the string
newStr := '';
for i := 1 to length(str) div 2 do
begin
newStr := newStr + str[i];
end;
writeln('String with characters deleted from the middle: ', newStr);
end.