Pagini recente » Cod sursa (job #1931406) | Cod sursa (job #2842143) | Cod sursa (job #551137) | Cod sursa (job #1378319) | Cod sursa (job #601311)
Cod sursa(job #601311)
Program text_3;
var ch:char;
s:set of char;
k,l,n,i,j,m,g:longint;
fi,fo:text;
begin
assign(fi,'text.in');
reset(fi);
assign(fo,'text.out');
rewrite(fo);
s:=['a'..'z','A'..'Z'];
while not eof(fi) do begin
read(fi,ch);
if ch in s then inc(l)
else if ch in ['0'..'9'] then inc(j)
else if ch='-' then begin
if l>0 then inc(g)
else g:=0;
if g>0 then inc(n);
end;
if ch in [chr(0)..chr(127)]-s then
if (l>0) and (j=0) and (n=0) then begin
inc(k);
m:=m+l;
l:=0;
end
else if j>0 then begin
l:=0;
j:=0;
end
else if (l>0) and (j=0) and (n>0) then begin
k:=k+1+n;
m:=m+l;
l:=0;
n:=0;
end;
end;
if k>1 then l:=m div k
else if k=1 then l:=m
else if k=0 then l:=0;
writeln(fo,l);
close(fo);
end.