Дан массив [1..n] и число m. Найдите количество элементов больше числа l
Answers & Comments
Giammy
Var m,n,k,i:integer; a:array[1..1000] of integer; begin write('Write size array: '); readln(n); write('Write m: '); readln(m); k:=0; for i:=1 to n do begin read(a[i]); if a[i]>m then inc(k); end; writeln(k); readln; readln end.
Answers & Comments
m,n,k,i:integer;
a:array[1..1000] of integer;
begin
write('Write size array: '); readln(n);
write('Write m: '); readln(m);
k:=0;
for i:=1 to n do
begin
read(a[i]);
if a[i]>m
then inc(k);
end;
writeln(k);
readln;
readln
end.