Cod sursa(job #761886)
var s:string;
L:set of char;
cuv:array[1..100] of string;
n,i,m,suma:byte;
f:text;
c:char;
begin
assign(f,'text.in');
reset(f);
read(f,s);
close(f);
assign(f,'text.out');
rewrite(f);
L:=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
i:=0;n:=length(s);m:=1;
while i<=n do
begin
inc(i);
c:=s[i];
if (c in L) or ((c='-') and (s[i+1] in L)) then cuv[m]:=cuv[m]+c;
if not(c in L) and (c<>'-') and (s[i+1] in L) then inc(m);
end;
for i:=1 to m do
suma:=suma+length(cuv[i]);
write(f,trunc(suma/m));
close(f);
end.