var Km Kd Sm Sd Cm Cd real begin readln while do begin Km Sm end Cm Sm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
var r,Km, Kd,Sm,Sd, K, S, Cm, Cd:real;
begin
S:=0;
K:=0;
readln (r);
while r<0 do
begin
Km:=K+1;
Sm:=S+r;
end;
Cm:=Sm/Km;
writeln(Cm);
end.