type a = array[0..999] of Integer; var B, num: a; var N, k: integer;
procedure SimpleNumber(B: a); begin for var i := 0 to N-1 do begin for var j := 2 to 9 do begin if B[i] mod num[j] <> 0 then k += 1; end; if k = 8 then begin write('Есть простое число'); break; end else if (k <> 8) and (i = N-1) then write('Нет простых чисел'); k := 0; end; end;
begin for var i := 2 to 9 do begin num[i] := i; end; read(N); for var i := 0 to N-1 do read(B[i]); SimpleNumber(B); end.
var
a : array [1..9] integer;
i : integer;
begin
for i := 1 to 9 do
if i mod 3 = 1 then a[i] := i
else if i mod 3 = 2 then a[i] := sqr (i - 1)
else a[i] := a[i - 1] div i;
for i := 1 to 9 do
write (a[i], ' ');
end.
var
b, a : array [1..15] of integer;
i, sa, sb : integer;
begin
randomize;
sa := 0; sb := 0;
for i := 1 to 15 do
begin
a[i] := trunc (random (100)) + 1;
write (a[i], ' ');
sa := sa + a[i];
end;
writeln;
for i := 1 to 15 do
begin
b[i] := sqr (a[i]) - a[i]);
write (b[i], ' ');
sb := sb + b[i];
end;
writeln;
writeln (abs (sb - sa));
end.
type a = array[0..999] of Integer;
var B, num: a; var N, k: integer;
procedure SimpleNumber(B: a);
begin
for var i := 0 to N-1 do begin
for var j := 2 to 9 do begin
if B[i] mod num[j] <> 0 then
k += 1;
end;
if k = 8 then begin
write('Есть простое число');
break;
end
else if (k <> 8) and (i = N-1) then
write('Нет простых чисел');
k := 0;
end;
end;
begin
for var i := 2 to 9 do begin
num[i] := i;
end;
read(N);
for var i := 0 to N-1 do
read(B[i]);
SimpleNumber(B);
end.