************chèn them pt vào mảng**************** program chenso; uses crt; var n,i,vtri,so:integer; A:array[1 50]of integer; begin write('nhap so pt trong mang:');readln(n); for i:=1 to n do begin write('nhap a[',i,']='); readln(a[i]); end; write('mang chua chen la: '); for i:=1 to n do write(a[i]:6); writeln; write('nhap vitri va so can chen');readln(vtri,so); for i:=n+1 downto vtri+1 do a[i]:=a[i-1]; a[vtri]:=so; write('mang sau khi chen: '); for i:=1 to n+1 do write(a[i]:6); readln end. ****************xoá pt trong mảng************* uses crt; var a,b,c:array[1 100]of integer; x,k,n,i,j:integer; begin clrscr; writeln('nhap so pt:');readln(n); for i:=1 to n do begin write('a[',i,']=');readln(a[i]); end; for i:=1 to n do write(a[i]:5); writeln; {them 1 pt vao mang} write('nhap vi tri can them');readln(j); write('nhap gia tri can them');readln(x); for i:=1 to n+1 do if i<>j then b[i]:=a[i] else begin for k:=j+1 to n+1 do b[k]:=a[k-1]; b[j]:=x; i:=n+1; end; for i:=1 to n+1 do write(b[i]:5);writeln; readln end. hoặc: program xoaso; uses crt; var i,n,vtri:integer; a:array[1 20]of integer; begin write('nhap so pt trong mang');readln(n); for i:=1 to n do begin write('nhap a[',i,']=');readln(a[i]); end; write('mang chua xoa: '); for i:=1 to n do write(a[i]:6); write('vi tri muon xoa:');readln(vtri); for i:=vtri to n-1 do a[i]:=a[i+1]; write('mang sau khi xoa: '); for i:= 1 to n-1 do write(a[i]:6); readln end. **************sap xep*************** program sapxep; uses crt; var n,i,j,tam:integer; a:array[1 2]of integer; begin write('nhap so pt:');readln(n); for i:=1 to n do begin write('nhap A[',i,']=');readln(a[i]); end; writeln; for i:=1 to n-1 do for j:=i+1 to n do if a[i]>a[j] then begin tam:=a[i]; a[i]:=a[j]; a[j]:=tam; end; for i:=1 to n do write(a[i]:8); readln end. hoặc program sapxep; uses crt; var n,i,j,tam:integer; a:array[1 2]of integer; begin write('nhap so pt:');readln(n); for i:=1 to n do begin write('nhap A[',i,']=');readln(a[i]); end; writeln; for j:=n downto 2 do for i:=1 to j-1 do if a[i]>a[i+1] then begin tam:=a[i]; a[i]:=a[i+1]; a[i+1]:=tam; end; for i:=1 to n do write(a[i]:8); readln end. ******************tim ky tự*************** program kitu; uses crt; var n,i,dem:integer;y:char; a:array[1 50]of char; begin write('mang co bao nhieu ktu: ');readln(n); for i:=1 to n do begin write('[a',i,']=');readln(a[i]); end; dem:=0; write('ki tu muon tim: ');readln(y); for i:=1 to n do if a[i]=y then dem:=dem+1; if dem=0 then write('ko co pt ',y,' nao') else write('so pt tu ',y,' la:',dem); readln end. ***************tbc sai so***************** rogram tbcsaiso; uses crt; var n,i:integer;tbc,tong:real; a:array[1 20]of real; begin write('nhap so pt trong mang:');readln(n); tong:=0; for i:=1 to n do begin write('nhap a[',i,']=');readln(a[i]);tong:=tong+a[i]; end; tbc:=tong/n; write('tbc=',tbc:5); writeln; write('nhung pt sai so 1 la:'); for i:=1 to n do if abs(tbc-a[i])<1 then write(a[i]:6) ; readln end. . ************chèn them pt vào mảng* *************** program chenso; uses crt; var n,i,vtri,so:integer; A:array[1 50]of. for i:=1 to n+1 do write(a[i]:6); readln end. ****************xoá pt trong mảng* ************ uses crt; var a,b,c:array[1 100]of integer; x,k,n,i,j:integer;