Pagini recente » Cod sursa (job #2104012) | Cod sursa (job #3349029) | Cod sursa (job #868372) | Cod sursa (job #3341503) | Cod sursa (job #170785)
Cod sursa(job #170785)
var
s:char;
f:text;
n,k,c:longint;
begin
assign(f,'text.in');
reset(f);
n:=0;
k:=0;
c:=0;
while not eof(f) do
begin
read(f,s);
if not (s in['a'..'z']) and not (s in ['A'..'Z']) then
begin
if c<>0 then
begin
n:=n+c;
k:=k+1;
end;
c:=0;
end
else c:=c+1;
end;
if c<>0 then
begin
n:=n+c;
k:=k+1;
end;
close(f);
assign(f,'text.out');
rewrite(f);
if k<>0 then write(f, trunc(n/k))
else write(f,0);
close(f);
end.