Xóa 1 phần tử trong mảng 1 chiều
var
n,i,q,k,p:integer;
a,b:array [1..1000] of integer;
begin
write('n= ');readln(n);
for i:=1 to n do
begin
write('a[',i,']= ');
readln(a[i]);
end;
write('Xoa pt co vi tri la: ');readln(p);
q:=0;
for i:=1 to n do
if q<>p then
begin
inc(q);
b[q]:=a[i];
end;
writeln('Mang sau khi xoa la: ');
for i:=1 to q do
write(b[i],' ');
readln
end.
0 nhận xét:
Đăng nhận xét
Click to see the code!
To insert emoticon you must added at least one space before the code.