Pagini recente » Cod sursa (job #512040) | Cod sursa (job #425428) | Cod sursa (job #2866468) | Cod sursa (job #3128738) | Cod sursa (job #533939)
Cod sursa(job #533939)
program ff;
var f,g:text;
c:char;
nrc,ltot,lcur:integer;
ok:boolean;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
nrc:=0; ltot:=0;
while not eof(f) do
begin
read(f,c);
if ((c>='a') and (c<='z')) or ((c>='A') and (c<='Z')) then
begin
lcur:=lcur+1;
ok:=true;
end
else
begin
ltot:=lcur+ltot;
lcur:=0;
if ok then
begin
inc(nrc);
end;
end;
end;
write(g,trunc(ltot/nrc));
close(f);
close(g);
end.