program ReplaceChars;
varstr: string;i: integer;
beginwriteln('Введите строку: ');readln(str);
writeln('Двоичный код:');for i := 1 to length(str) dobeginif str[i] = 'X' thenwrite('1')else if str[i] = '.' thenwrite('0');end;
end.
program ReplaceChars;
var
str: string;
i: integer;
begin
writeln('Введите строку: ');
readln(str);
writeln('Двоичный код:');
for i := 1 to length(str) do
begin
if str[i] = 'X' then
write('1')
else if str[i] = '.' then
write('0');
end;
end.