Bài 1:
uses crt;
var a:array[1..100]of integer;
i,n,dem:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 3<>0 then inc(dem);
writeln('So phan tu khong chia het cho 3 trong day la: ',dem);
readln;
end.
Bài 2:
uses crt;
var a:array[1..250]of integer;
i,n,t:integer;
begin
clrscr;
write('nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
if a[i]>=0 then t:=t+a[i];
writeln('Tong cac phan tu khong am trong day la: ',t);
readln;
end.