Pagini recente » Cod sursa (job #1583181) | Cod sursa (job #2287108) | Cod sursa (job #485899) | Cod sursa (job #219545) | Cod sursa (job #83967)
Cod sursa(job #83967)
var s,x,y,i,j:longint;
f1,f2:text;
c:char;
begin
Assign(f1,'text.in');reset(f1);
Assign(f2,'text.out');rewrite(f2);
x:=0;j:=0;s:=0;i:=0;
while not eof(f1) do begin
read(f1,c);
if (ord(c)>=ord('a'))and(ord(c)<=ord('z'))or(ord(c)>=ord('A'))and(ord(c)<=ord('Z'))then begin
i:=i+1;
if c=' '
then begin
s:=s+i-x;
j:=j+1;
If y=0 then y:=i;
x:=y;
y:=i;
end;
end;
end;
s:=s+i-x;
j:=j+1;
writeln(f2,s div j);
close(f1);
close(f2);
end.