Pagini recente » Cod sursa (job #1687978) | Cod sursa (job #638761) | Cod sursa (job #1374925) | Rating Mihnea Sidorencu (Mihneass) | Cod sursa (job #179372)
Cod sursa(job #179372)
const m:set of char=['a'..'z','A'..'Z'];
var a,b,nr,s:longint;
c:char;
f,g:text;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
a:=0;
b:=0;
s:=0;
nr:=0;
while not eof(f) do begin
read(f,c);
if c in m then
if a=0 then begin
a:=1;
b:=1;
end
else b:=b+1
else begin if a<>0 then begin
s:=s+b;
nr:=nr+1;
end;
a:=0;
b:=0;
end;
end;
if a<>0 then begin
s:=s+b;
inc(nr);
end;
writeln(g,s div nr);
close(f);
close(g);
end.