Răspuns:
program numarX;
const nmax=100;
type tablou=array[1..nmax]of integer;
var t:tablou; n,i,x,c:integer;
procedure contor(n,x:integer;t:tablou;var c:integer);
var i,nr:integer;
begin
nr:=0;
for i:=1 to n do
begin
if t[i]=x then inc(nr);
end;
c:=nr;
end;
begin
read(n);
for i:=1 to n do
read(t[i]);
write('x=');read(x);
contor(n,x,t,c);
writeln(c);
end.
Explicație: