var m:array[1..100] of integer; n,i,k,d:integer; begin clrscr; write(‘Nhap so luong phan tu: ‘); readln(n); for i:=1 to n do begin write(‘nhap m[‘,i,’]: ‘); readln(a[i]); end; write(‘Nhap k: ‘); readln(k); for i:=1 to n do if m[i]=k then d:=d+1; writeln(‘Co ‘,d,’ phan tu cua day bang k’); readln; end.
program xuathien;
uses crt;e(‘Nhap
var A:array[1..100] of integer;
m,i,k,d:integer;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘); readln(m);
writeln(‘Nhap tung phan tu cua day: ‘);
for i:=1 to m do
begin
write(‘A[‘,i,’]= ‘);
readln(A[i]);
end;
write(‘Nhap k: ‘); readln(k);
d:=0;
for i:=1 to m do
if A[i]=k then inc(d);
writeln(‘Co ‘,d,’ phan tu cua day bang ‘,k);
readln
end.
uses crt;
var m:array[1..100] of integer;
n,i,k,d:integer;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘); readln(n);
for i:=1 to n do
begin
write(‘nhap m[‘,i,’]: ‘); readln(a[i]);
end;
write(‘Nhap k: ‘); readln(k);
for i:=1 to n do
if m[i]=k then d:=d+1;
writeln(‘Co ‘,d,’ phan tu cua day bang k’);
readln;
end.