1)
var n, k, s: integer;
a: array[1..9999] of integer;
begin
read(n); //кол-во чисел
read(k);
for var i := 1 to n do begin
a[i] := random(1, 10);
write(a[i] + ' ');
if a[i] mod k = 0 then
s += a[i];
end;
writeln;
write(s);
end.
14)
var a: array[1..9999] of integer;
n, k: integer;
begin
read(n); //кол-во учащихся
for var i := 1 to n do begin
a[i] := random(2, 5);
write(a[i] + ' ');
if a[i] = 2 then
k += 1;
end;
writeln;
write(k);
end.
15)
var a: array[1..9999] of integer;
n: integer;
begin
read(n);
for var i := 1 to n do
a[i] := random(1, 10);
a[random(1, n)] := 0;
for var i := 1 to n do
write(a[i] + ' ');
writeln;
for var i := 1 to n do begin
if a[i] <> 0 then
write(a[i] + ' ')
else begin
write(a[i]);
break;
end;
end
end.
21)
var a: array[1..9999] of integer;
n, c, d: integer;
begin
read(n);
read(c, d);
for var i := 1 to n do begin
a[i] := random(1, 100);
write(a[i] + ' ');
end; writeln;
for var i := 1 to n do begin
if (a[i] >= c) and (a[i] <= d) then</strong>
write(a[i] + ' ');
end;
end.