Ответ:
var a,b,c,d,min:real;
flag: boolean;
begin
flag:=true;
writeln(‘Enter A, B, C, D numbers:’);
readln(a,b,c,d);
if (a=d) then begin
writeln(‘a equals to d!’);
flag:=false;
min:=a;
end;
if (b=d) then begin
writeln(‘b equals to d!’);
flag:=false;
if (b<min) then min:=b;
end;
if (c=d) then begin
writeln(‘c equals to d!’);
flag:=false;
if (c<min) then min:=c;
end;
if flag then writeln(‘Max difference: ‘,d-min);
end.