Program HOC24;
var i,n,k: integer;
a: array[1..20] of integer;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
write('Vi tri cac phan tu co gia tri bang ',k,': ');
for i:=1 to n do if a[i]=k then write(i,' ');
writeln;
for i:=1 to n do if a[i]=k then a[i]:=-k;
write('Mang sau khi thay the la: ');
for i:=1 to n do write(a[i],' ');
readln
end.