Ответ:
program Max;
var
massiv: array [1..4] of integer;
i: integer;
max: integer;
filetext: text;
begin
assign(filetext,'c:\text.txt');
rewrite (filetext);
for i:=1 to 4 do begin
readln(massiv[i]);
WriteLn(filetext,massiv[i]);
end;
max := massiv[1];
for i:=2 to 4 do begin
if massiv[i]>max then
max := massiv[i];
end;
writeln(filetext,max);
close(filetext);
end.
Объяснение: