Var R1, R2, R3, S1, S2, S3: Integer; begin writeln('Введите размеры рации и чемодана'); readln(R1, R2, R3, S1, S2, S3); if ((R1 < S1) and (R2 < S2) and (R3 < S3)) or ((R3 < S3) and (R2 < S1) and (R1 < S2)) or ((R1 < S1) and (R2 < S3) and (R3 < S3)) or ((R2 < S2) and (R1 < S3) and (R3 < S1)) or ((R2 < S1) and (R3 < S2) and (R1 < S3)) or ((R1 < S2) and (R3 < S1) and (R2 < S3)) then WriteLn('ПОМЕЩАЕТСЯ') else WriteLn('НЕ ПОМЕЩАЕТСЯ'); end.
R1, R2, R3, S1, S2, S3: Integer;
begin
writeln('Введите размеры рации и чемодана');
readln(R1, R2, R3, S1, S2, S3);
if ((R1 < S1) and (R2 < S2) and (R3 < S3)) or
((R3 < S3) and (R2 < S1) and (R1 < S2)) or
((R1 < S1) and (R2 < S3) and (R3 < S3)) or
((R2 < S2) and (R1 < S3) and (R3 < S1)) or
((R2 < S1) and (R3 < S2) and (R1 < S3)) or
((R1 < S2) and (R3 < S1) and (R2 < S3)) then
WriteLn('ПОМЕЩАЕТСЯ')
else
WriteLn('НЕ ПОМЕЩАЕТСЯ');
end.
a: array[1..10]of integer;
i, k, n: integer;
begin
Writeln('Исходный массив:');
Randomize;
for i := 1 to 10 do
begin
a[i] := Random(51) - 25;
Write(a[i], ' ');
end;
Writeln;
n := 0;
k := 0;
for i := 10 downto 1 do
if a[i] > 0 then
begin
k := k + 1;
if k = 2 then n := i;
end;
if k = 0 then
Writeln('В массиве нет положительных элементов!')
else
Writeln('Предпоследний положительный элемент: a[', n, '] = ', a[n]);
Readln;
end.