program nchppch;
uses
crt;
const
n = 5;
const
mch = 100;
//максимальное число
var
i, min: integer;
var
a: array [1..n] of integer;
begin
min := mch;
for i := 1 to n do
a[i] := random(mch + 1);
//рандом для проверки программы
for i := 1 to n do
writeln(a[i]);
//цикл для проверки массива
writeln;
for i := 2 to n do
if ((a[i] = 2) or (a[i] = 3) or (a[i] = 5) or (a[i] = 7) or (a[i] = 11) or (a[i] = 13) or (a[i] = 17) or (a[i] = 19) or (a[i] = 23) or (a[i] = 29) or (a[i] = 31) or (a[i] = 37) or (a[i] = 41) or (a[i] = 43) or (a[i] = 47) or (a[i] = 53) or (a[i] = 59) or (a[i] = 61) or (a[i] = 67) or (a[i] = 71) or (a[i] = 73) or (a[i] = 79) or (a[i] = 83) or (a[i] = 89) or (a[i] = 97) or (a[i] = 101)) and (a[i - 1] < min) then
min := a[i - 1] ;
writeln(min);
readln;
end.
Используются простые числа от 1 до 101.
До 1000: на фото.