Pagini recente » Cod sursa (job #1353302) | Cod sursa (job #201323) | Statistici Zarioiu Denisa (denisa0230) | Cod sursa (job #221431) | Cod sursa (job #1051749)
var c:char;
nr,lg,k:longint;
f,g:text;
function y(x:char):boolean;
begin
if (x>='a') and(x<='z')
or (x>='A')and(x<='Z') then y:=true
else y:=false;
end;
begin
assign(f,'text.in ');reset(f);
assign(g,'text.out');rewrite(g);
lg:=0;k:=0;nr:=0;
while not eof(f) do
begin
read(f,c);
if y(c)=true then inc(k)
else if k<>0 then begin
inc(nr);
lg:=lg+k;
k:=0;
end;
end;
if k<>0 then begin
inc(nr);
lg:=lg+k;
k:=0;
end;
if (nr<>0) and(lg<>0) then write(g,lg div nr)
else write(g,0);
close(f);
close(g);
end.