program tin_hoc;
uses crt;
var n,dem,t: integer; s:real;
begin
clrscr;
write('------------tinh trung binh cong,nhap 0 de ket thuc------------');
write('Nhap so tu ban phim :'); readln(n);
t:=n;dem:=1;
while n<>0 do
Begin
write('Nhap so tu ban phim:'); readln(n);
t:=t+n;dem:=dem+1;
end;
s:= t /(dem-1);
write(s);
readln
end.