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.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку