Pagini recente » Cod sursa (job #2856555) | Cod sursa (job #2806950) | Cod sursa (job #720328) | Cod sursa (job #2849337) | Cod sursa (job #53138)
Cod sursa(job #53138)
var s:char;
fi,fo:text;
ct,suma,ctcuv,rez:longint;
begin
assign(fi,'text.in'); reset(fi);
assign(fo,'text.out'); rewrite(fo);
ct:=0; ctcuv:=0; suma:=0;
while not eof(fi) do
begin
read(fi,s);
if s in ['a'..'z','A'..'Z'] then inc(ct)
else begin
if ct>0 then inc(ctcuv);
suma:=suma+ct;
ct:=0; end;
end;
rez:=suma div ctcuv;
writeln(fo,rez);
close(fi); close(fo);
end.