Pagini recente » Cod sursa (job #1535221) | Cod sursa (job #91465) | Cod sursa (job #1463725) | Cod sursa (job #2285649) | Cod sursa (job #168123)
Cod sursa(job #168123)
{ http://infoarena.ro/problema/text }
var f,g:text;
nrcuv,lungcuv:longint;
c:char;
q:boolean;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
nrcuv:=0; lungcuv:=0;
q:=false;
while not(eof(f)) do
begin
read(f,c);
if (c in ['A'..'z']) or (c in ['0'..'9']) then begin
lungcuv:=lungcuv+1;
q:=true;
end
else if q then begin
nrcuv:=nrcuv+1;
q:=false;
end;
end;
if (c in ['A'..'z']) or (c in ['0'..'9']) then nrcuv:=nrcuv+1;
write(g,trunc(lungcuv/nrcuv));
close(f); close(g);
end.