Есть ответ 👍

Надеюсь на вашу ! написать программу на языке pasсal, меняющую все слова "red" на "black", "tree" на "palms" из текста, указанного в файле in.txt и сохраняющую результат в файл out.txt. все остальные слова, пробелы, запятые, точки и т.п должны остаться без изменений. вот сам текст: a red black tree is a binary search tree where each node has a color attribute the value of which is either red or black in addition to the ordinary requirements imposed on binary search trees the following requirements apply to red black trees. a node is either red or black the root is black this rule is sometimes omitted from other definitions. since the root can always be changed from red to black but not necessarily vice versa this rule has little effect on analysis. all leaves are the same color as the root both children of every red node are black. every simple path from a given node to any of its descendant leaves contains the same number of black, black, black, very "black" nodes.

233
500
Посмотреть ответы 2

Ответы на вопрос:

alekseevvv
4,5(46 оценок)

Var myinfile, myoutfile: text;     ind: integer;     currentstring: string; begin     assign(myinfile, 'in.txt');     reset(myinfile);     assign(myoutfile, 'out.txt');     rewrite(myoutfile);     while (not eof(myinfile)) do     begin       currentstring : = readln(myinfile);       while  (pos('red',  currentstring) > 0) do       begin           ind : =  pos(currentstring, 'red');           delete(currentstring, ind, length('red'));           insert('black', currentstring, ind);       end;       while  (pos('tree',  currentstring) > 0) do       begin           ind : =  pos(currentstring, 'tree');           delete(currentstring, ind, length('tree'));           insert('palms', currentstring, ind);       end;     end;     close(myinfile);     close(myoutfile); end.
Litoli
4,4(38 оценок)

print (5+8*2)

Объяснение:

Реши свою проблему, спроси otvet5GPT

  • Быстро
    Мгновенный ответ на твой вопрос
  • Точно
    Бот обладает знаниями во всех сферах
  • Бесплатно
    Задай вопрос и получи ответ бесплатно

Популярно: Информатика

Caktus Image

Есть вопросы?

  • Как otvet5GPT работает?

    otvet5GPT использует большую языковую модель вместе с базой данных GPT для обеспечения высококачественных образовательных результатов. otvet5GPT действует как доступный академический ресурс вне класса.
  • Сколько это стоит?

    Проект находиться на стадии тестирования и все услуги бесплатны.
  • Могу ли я использовать otvet5GPT в школе?

    Конечно! Нейросеть может помочь вам делать конспекты лекций, придумывать идеи в классе и многое другое!
  • В чем отличия от ChatGPT?

    otvet5GPT черпает академические источники из собственной базы данных и предназначен специально для студентов. otvet5GPT также адаптируется к вашему стилю письма, предоставляя ряд образовательных инструментов, предназначенных для улучшения обучения.

Подпишись на наш телеграмм канал

GTP TOP NEWS