Pagini recente » Cod sursa (job #2789564) | Cod sursa (job #1258225) | Cod sursa (job #1228040) | Cod sursa (job #1984869) | Cod sursa (job #248528)
Cod sursa(job #248528)
{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:='';
while not eof(f) do
begin
read(f,c);
if upcase(c) in ['A'..'Z'] then cuv:=cuv+c
else begin
if cuv<>'' then
begin
l:=l+length(cuv);
inc(nr);
end;
cuv:='';
end;
end;
if (nr<>0) and (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.