П. 17 , №1,2,3,4,7, 9 выполнить письменно. Издательство бином 6 класс Л.Л. Бсова А.Ю Босова сделать желательно написать на листке и скинуть, не зря же поставил
Var ar:array[1..n] of integer; ar2:array[1..n] of integer; i,k:integer;
function prost(a:integer):boolean; var i:integer; b:boolean; begin b:=true; for i:=2 to a div 2 do if a mod i=0 then begin; b:=false; break; end; if a=1 then b:=false; prost:=b; end;
begin; randomize; k:=0; for i:=1 to n do begin; ar[i]:=random(101); write(ar[i]:4); end; writeln; for i:=1 to n do if prost(ar[i]) then begin; inc(k); ar2[k]:=ar[i]; write(ar2[k]:4); end; end.
var mas1, mas2: array[0..9] of integer; t, k, i, j: integer; begin readln(t); readln(k); for j := 0 to 1 do begin if (j = 1) then writeln(); for i := 0 to 9 do begin if(j = 0) then begin mas1[i] := random(100); write(mas1[i], ' '); if mas1[i] > t Then mas1[i] := mas1[i] + 4; end else begin mas2[i] := random(100); write(mas2[i], ' '); if mas2[i] > 10 * K Then mas2[i] := mas2[i] + K; end; end; for i := 0 to 9 do if (j = 0) then write(mas1[i]) else write(mas2[i]); writeln(); end; readln(); end.
n=5;
Var
ar:array[1..n] of integer;
ar2:array[1..n] of integer;
i,k:integer;
function prost(a:integer):boolean;
var i:integer;
b:boolean;
begin
b:=true;
for i:=2 to a div 2 do
if a mod i=0 then
begin;
b:=false;
break;
end;
if a=1 then b:=false;
prost:=b;
end;
begin;
randomize;
k:=0;
for i:=1 to n do
begin;
ar[i]:=random(101);
write(ar[i]:4);
end;
writeln;
for i:=1 to n do
if prost(ar[i]) then
begin;
inc(k);
ar2[k]:=ar[i];
write(ar2[k]:4);
end;
end.
begin
readln(t);
readln(k);
for j := 0 to 1 do begin
if (j = 1) then writeln();
for i := 0 to 9 do begin
if(j = 0) then begin
mas1[i] := random(100);
write(mas1[i], ' ');
if mas1[i] > t Then mas1[i] := mas1[i] + 4;
end
else
begin
mas2[i] := random(100);
write(mas2[i], ' ');
if mas2[i] > 10 * K Then
mas2[i] := mas2[i] + K;
end;
end;
for i := 0 to 9 do
if (j = 0) then
write(mas1[i])
else
write(mas2[i]);
writeln();
end;
readln();
end.
))