uses crt;
var a,t,dem:integer;
begin
clrscr;
t:=0;
dem:=0;
repeat
write('Nhap a='); readln(a);
if (a mod 2=0) and (a mod 3=0) then
begin
t:=t+a;
dem:=dem+1;
end;
until a=0;
writeln('Trung binh cong cua cac so chia het cho 3 va 2 la: ',t/dem:4:2);
readln;
end.