program nhap;
uses crt;
var A:array [1..1000] of integer;
n,i,dem:integer;
begin
writeln ('nhap vao so phan tu cua mang');readln (n);
for i:=1 to n do readln (A[i]);
write ('cac so chia het cho 3 va 9 la: ');
for i:=1 to n do
if (A[i] mod 3 =0) and A[i] mod 9=0) then
begin
write (A[i]);
dem:=dem+1;
end;
writeln ('co tat ca ',dem,' so chia het cho 3 va 9');
readln end.
program Chia_het;
uses crt;
var A: array[1..100] of integer;
n,i: integer;
begin
clrscr;
writeln('Nhap n so tu nhien'); readln(n);
for i:=1 to n do begin writeln('A[',i,']='); readln(A[i]) end;
for i:=1 to n do
if A[i] mod 3 = 0 then writeln(A[i]);
for i:=1 to n do
if A[i] mod 9 = 0 then writeln(A[i]);
readln
end.
*EDIT: Mình chỉ làm ý 1 của bạn thôi.