Pagini recente » Cod sursa (job #2947262) | Cod sursa (job #1359337) | Cod sursa (job #1779857) | Cod sursa (job #2619936) | Cod sursa (job #287331)
Cod sursa(job #287331)
{text}
var f,g:text;
c:char;
cuv:string;
l,nr:longint;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
cuv:='';
nr:=0;
l:=0;
while not eof(f) do
begin
read(f,c);
while upcase(c) in ['A'..'Z'] do
begin
cuv:=cuv+c;
read(f,c);
end;
if cuv<>'' then
begin
l:=l+length(cuv);
inc(nr);
cuv:='';
end;
if upcase(c) in ['A'..'Z'] then cuv:=cuv+c;
end;
if upcase(c) in ['A'..'Z'] then
begin
l:=l+length(cuv);
inc(nr);
end;
if nr=0 then writeln(g,0)
else writeln(g,trunc(l/nr),' ');
close(f);
close(g);
end.