uses crt;
var a, b, c, n, i, j :integer;
s :array [1..10000] of integer;
begin
clrscr;
writeln ('Vvedite razmer masiva');
read (n);
writeln ('Vvedite chislo X');
read (a);
for i:=1 to n do
begin
writeln ('Vvedit s[', i, '] element');
read (s[i]);
end;
for i:=1 to n do
for j:=1 to n-1 do
if s[j]
begin
b:=s[j];
s[j]:=s[j+1];
s[j+1]:=b;
end;
for i:=1 to n do
begin
write (s[i], ' ');
if s[i]=a then inc (c);
end;
writeln;
if c>0 then writeln ('3adanoe chislo prisytstvyet') else writeln('3adanoe chislo otsytstvyet');
end.
P.S. Надеюсь на благодарность и лучший ответ.