Pagini recente » Cod sursa (job #1512898) | Cod sursa (job #3178618) | Cod sursa (job #2969327) | Cod sursa (job #582721) | Cod sursa (job #170767)
Cod sursa(job #170767)
var
s:ansistring;
f:text;
n,k,c,i:int64;
begin
assign(f,'text.in');
reset(f);
read(f,s);
n:=0;
k:=0;
c:=0;
i:=1;
while not eof(f)do
begin
if not (s[i] in['a'..'z']) and not (s[i] in ['A'..'Z']) then
begin
if c<>0 then
begin
n:=n+c;
k:=k+1;
end;
c:=0;
end
else c:=c+1;
i:=i+1;
end;
close(f);
assign(f,'text.out');
rewrite(f);
if k<>0 then write(f, trunc(n/k));
close(f);
end.