program lista_uproszczona_usun_x_z_listy;
type tab=array[1..10]of integer;
lst = record
elementy: tab;
ile: integer
end;
var
i, j, wartosc, pozycja: integer;
x: lst;
znaleziono: boolean;
begin
read(x.ile);
for i := 1 to x.ile do
read(x.elementy[i]);
read(wartosc);
znaleziono := false;
for i := 1 to x.ile do
begin
if x.elementy[i] = wartosc then
begin
pozycja := i;
znaleziono := true;
break;
end;
end;
if znaleziono then
begin
writeln('Pozycja: ', pozycja);
for i := pozycja to x.ile-1 do
x.elementy[i] := x.elementy[i+1];
x.ile := x.ile - 1;
end
else
writeln('Nie znaleziono wartości ', wartosc);
for i := 1 to x.ile do
write(x.elementy[i], ' ');
end.
cHJvZ3JhbSBsaXN0YV91cHJvc3pjem9uYV91c3VuX3hfel9saXN0eTsKdHlwZSB0YWI9YXJyYXlbMS4uMTBdb2YgaW50ZWdlcjsKICAgICBsc3QgPSByZWNvcmQKICAgICAgICAgICAgICAgIGVsZW1lbnR5OiB0YWI7CiAgICAgICAgICAgICAgICBpbGU6IGludGVnZXIKICAgICAgICAgICAgIGVuZDsKdmFyCiAgICBpLCBqLCB3YXJ0b3NjLCBwb3p5Y2phOiBpbnRlZ2VyOwogICAgeDogbHN0OwogICAgem5hbGV6aW9ubzogYm9vbGVhbjsKICAgIApiZWdpbgoKICAgIHJlYWQoeC5pbGUpOwogICAgZm9yIGkgOj0gMSB0byB4LmlsZSBkbwogICAgICAgIHJlYWQoeC5lbGVtZW50eVtpXSk7CgogICAgcmVhZCh3YXJ0b3NjKTsKCiAgICB6bmFsZXppb25vIDo9IGZhbHNlOwogICAgZm9yIGkgOj0gMSB0byB4LmlsZSBkbwogICAgYmVnaW4KICAgICAgICBpZiB4LmVsZW1lbnR5W2ldID0gd2FydG9zYyB0aGVuCiAgICAgICAgYmVnaW4KICAgICAgICAgICAgcG96eWNqYSA6PSBpOwogICAgICAgICAgICB6bmFsZXppb25vIDo9IHRydWU7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGVuZDsKICAgIGVuZDsKICAgIAogICAgaWYgem5hbGV6aW9ubyB0aGVuCiAgICBiZWdpbgogICAgICAgIHdyaXRlbG4oJ1BvenljamE6ICcsIHBvenljamEpOwogICAgICAgIAogICAgICAgIGZvciBpIDo9IHBvenljamEgdG8geC5pbGUtMSBkbwogICAgICAgICAgICB4LmVsZW1lbnR5W2ldIDo9IHguZWxlbWVudHlbaSsxXTsKICAgICAgICAgICAgCiAgICAgICAgeC5pbGUgOj0geC5pbGUgLSAxOwogICAgZW5kCiAgICBlbHNlCiAgICAgICAgd3JpdGVsbignTmllIHpuYWxlemlvbm8gd2FydG/Fm2NpICcsIHdhcnRvc2MpOwoKIAogICAgZm9yIGkgOj0gMSB0byB4LmlsZSBkbwogICAgICAgIHdyaXRlKHguZWxlbWVudHlbaV0sICcgJyk7CmVuZC4=