program sls;
var
a : array [1..10] of integer;
i,x,counter : integer;
begin
randomize;
counter := 0;
for i := 1 to 10 do
a[i] := random(50) - 10;
readln(x);
if a[i] > x then
counter := counter + 1;
end;
write(counter);
end.
##
var n := ReadInteger('Число элементов =');
var x := ReadInteger('X =');
var a := ArrRandom(n, 10, 50);
a.Println;
Print('Число элементов, больших', X, 'равно', a.Count(t -> t > x))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program sls;
var
a : array [1..10] of integer;
i,x,counter : integer;
begin
randomize;
counter := 0;
for i := 1 to 10 do
a[i] := random(50) - 10;
readln(x);
for i := 1 to 10 do
begin
if a[i] > x then
counter := counter + 1;
end;
write(counter);
end.
##
var n := ReadInteger('Число элементов =');
var x := ReadInteger('X =');
var a := ArrRandom(n, 10, 50);
a.Println;
Print('Число элементов, больших', X, 'равно', a.Count(t -> t > x))