var
A: array [1..3] of Integer;
i, imin, imax, imid: Integer;
begin
Write('Введите 3 целых различных числа: ');
Readln(A [1], A [2], A [3]);
if (A [1] = A [2]) or (A [2] = A [3]) or (A [1] = A [3]) then begin
Writeln ('Имеются одинаковые числа!');
Exit;
end;
imin := 1;
imax := 1;
for i := 2 to 3 do begin
if A [i] < A [imin] then
imin := i;
if A [i] > A [imax] then
imax := i;
end;
for i := 1 to 3 do begin
if (i <> imin) and (i <> imax) then
imid := i;
end;
Writeln ('Произведение максимального и среднего числа = ' + IntToStr (A [imax] * A [imid]));
end;
<em>// PascalABC.NET 3.2, сборка 1344 от 22.11.2016</em>
begin
var a:=ReadReal('Введите число');
Write(a,' ');
if (a<2) or (a>12) then Write('не ');
Writeln('принадлежит интервалу [2;12]')
end.
<u>Примеры</u>
Введите число 3.18
3.18 принадлежит интервалу [2;12]
Введите число 16
16 не принадлежит интервалу [2;12]
//FPC 2.6.4
Program sieve_of_Eratosthenes;
var
n, i, x:integer;
a: array[1..32000] of boolean;
begin
readln(n);
for i:=2 to (n+1) div 2 do
begin
x:=i*2;
while x<=n do
begin
a[x]:=true;
x:=x+i;
end;
x:=0;
end;
for i:=1 to n do if not a[i] then write(i,' ');
readln;
end.