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.
n = int(input('Сколько у вас друзей? '))
input('Введите имена своих друзей(через пробел) ')
names=input().split()
for i in range(n):
names[i] = str(names[i])
print(names[i],end = ' ')