program shet;
uses crt;
var mas: array [1..10] of integer;
i, sh: integer;
begin
for i:=1 to 10 do
mas[i]:=random(10);
write(mas[i], ' ');
if (mas[i] mod 2 = 0) then sh:= sh + 1;
end;
writeln;
write(sh, ' shetnix shisel');
end.
program mas;
var a: array [1..20] of integer;
i, x: integer;
a[i]:=random(100);
write(a[i], ' ');
writeln('Enter x');
readln(x);
if (a[i] < x)then write (a[i], ' ');
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Первая задача:
program shet;
uses crt;
var mas: array [1..10] of integer;
i, sh: integer;
begin
for i:=1 to 10 do
begin
mas[i]:=random(10);
write(mas[i], ' ');
if (mas[i] mod 2 = 0) then sh:= sh + 1;
end;
writeln;
write(sh, ' shetnix shisel');
end.
Вторая задача:
program mas;
uses crt;
var a: array [1..20] of integer;
i, x: integer;
begin
for i:=1 to 10 do
begin
a[i]:=random(100);
write(a[i], ' ');
end;
writeln;
writeln('Enter x');
readln(x);
for i:=1 to 10 do
begin
if (a[i] < x)then write (a[i], ' ');
end;
end.