Pagini recente » Cod sursa (job #1451910) | Cod sursa (job #1558695) | Cod sursa (job #1286820) | Cod sursa (job #3169146) | Cod sursa (job #603881)
Cod sursa(job #603881)
Program text_3;
var ch:char;
s:set of char;
k,l,m:longint;
b1,b2: array [1..1 shl 16] of char;
fi,fo:text;
begin
assign(fi,'text.in');
reset(fi);
assign(fo,'text.out');
rewrite(fo);
settextbuf(fi,b1);
settextbuf(fo,b2);
s:=['a'..'z','A'..'Z']; m:=0; k:=0;
while not eof(fi) do begin
read(fi,ch);
if ch in s then inc(l)
else
if (ch in [chr(0)..chr(127)]-s) and (l>0) then begin
inc(k);
m:=m+l;
l:=0;
end;
end;
if l<>0 then begin
inc(k);
m:=m+l;
end;
writeln(fo,m div k);
close(fo);
end.