uses crt;
var a:array[1..100]of integer;
i,n,k,dem:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
readln(k);
dem:=0;
for i:=1 to n do
if a[i]>k then inc(dem);
write(dem);
readln;
end.
Đúng 2
Bình luận (1)
program countGreaterThanK;
var
A: array[1..100] of integer;
N, K, count: integer;
i: integer;
begin
write('Nhap so phan tu cua day A (<=100): ');
readln(N);
write('Nhap gia tri K: ');
readln(K);
count := 0;
for i := 1 to N do
begin
write('Nhap phan tu thu ', i, ' cua day A: ');
readln(A[i]);
if A[i] > K then
count := count + 1;
end;
writeln('So phan tu co gia tri lon hon K la: ', count);
end.
Đúng 1
Bình luận (1)