program suma;
USES CRT;
var
a, b, d, s: integer;
c: real;
begin
clrscr;
writeln ('program liczący średnią podanych liczb');
writeln ('aby zakończyć wpisywanie liczb, podaj 0');
s:=0;
b:=0;
REPEAT
writeln ('podaj liczbę całkowitą');
readln (a);
s:=s+1;
b:=b+a;
UNTIL a=0;
begin
c:= b/s;
writeln ('średnia=', c :100:2);
end;
readln;
end.