Определите, что будет напечатано в результате работы следующей программы: var m, n : integer; begin m : = 50; for n : = 1 to 7 do m : = m – 7; write(m); end.
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.
50-7=43
43-7=36
36-7=29
29-7=22
22-7=15
15-7=8
8-7=1
На экран выведет 1