Pagini recente » Cod sursa (job #1677898) | Cod sursa (job #2048226) | Cod sursa (job #2685531) | Cod sursa (job #1724090) | Cod sursa (job #168117)
Cod sursa(job #168117)
{ 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'] 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'] then nrcuv:=nrcuv+1;
write(g,trunc(lungcuv/nrcuv));
close(f); close(g);
end.