Program Min_Max;
uses crt;
var a:array[1..3] of integer;
i,min,max:integer;
begin
Textcolor (12);
For i:=1 to 3 do
Begin
A[i]:=random(100);
Write(A[i]:4);
End;
Writeln;
min:=a[1];
for i:=1 to 3 do
if a[i]>max then
max:=a[i];
if a[i]<min then
min:=a[i];
end;
write(' ');
if a[i]=max then
textcolor(12);
write(max:3);
if a[i]=min then
textcolor(9);
write(min:3);
if (a[i]<>min) and (A[i]<>max) then
textcolor(14);
write(A[i]:3);
readln;
end.
Объяснение:
Program Min_Max;
uses crt;
var a:array[1..3] of integer;
i,min,max:integer;
begin
Textcolor (12);
For i:=1 to 3 do
Begin
A[i]:=random(100);
Write(A[i]:4);
End;
Writeln;
min:=a[1];
for i:=1 to 3 do
begin
if a[i]>max then
max:=a[i];
if a[i]<min then
min:=a[i];
end;
write(' ');
for i:=1 to 3 do
begin
if a[i]=max then
Begin
textcolor(12);
write(max:3);
End;
if a[i]=min then
Begin
textcolor(9);
write(min:3);
End;
if (a[i]<>min) and (A[i]<>max) then
Begin
textcolor(14);
write(A[i]:3);
End;
End;
readln;
end.
Объяснение: