Program mathlover12;
const
n = 6; {Количество элементов массива}
var
a:array[1..n] of integer;
s:string;
i,min,max: integer;
begin
s:=' -=Alphaeus=- ';
for i:=1 to 22 do begin write(s[i]); sleep(42) end;
{вводим элементы массива}
writeln; writeln('Введите ',n,' чисел:');
for i:=1 to n do read(a[i]);
{Ищем min и max}
min:=a[1];
max:=a[1];
for i:=2 to n do
begin
if min>a[i] then min:=a[i];
if max<a[i] then max:=a[i];
end;
{Выводим произведение min и max}
writeln; writeln;
writeln('Произведение min и max равнo ',min*max);
end.
const
cx = 200;
cy = 200;
radius = 150;
procedure Chandelier(PenColor, BrushColor: Color);
begin
SetPenColor(PenColor);
SetBrushColor(BrushColor);
Line(cx, 0, cx, cy - radius);
FillPie(cx, cy, radius, 0, 180);
Ellipse(cx - radius, cy - 30, cx + radius, cy + 30);
end;
procedure Dark();
begin
ClearWindow(clBlack);
Chandelier(clGreen, clDarkGreen);
SetBrushColor(clBlack);
SetFontColor(clWhite);
TextOut(cx - 30, 2 * cy - 50, 'False');
end;
procedure Light();
begin
ClearWindow(clSilver);
SetBrushColor(clLightGoldenrodYellow);
FillPie(cx, cy - radius div 2, 3 * cx, 210, 330);
Chandelier(clGreen, clLime);
SetBrushColor(clYellow);
FillCircle(cx, cy - radius div 2, 35);
SetBrushColor(clLightGoldenrodYellow);
SetFontColor(clBlack);
TextOut(cx - 30, 2 * cy - 50, 'True');
end;
procedure DrawLamp(state: Boolean);
begin
if state then
Light()
else Dark();
end;
var
LampState: Boolean;
key: Char;
begin
SetWindowSize(2 * cx, 2 * cy);
SetFontSize(20);
LampState := False;
repeat
DrawLamp(LampState);
key := ReadChar();
if key = 'h' then
LampState := not LampState;
until key = #27;
end.