Pagini recente » Cod sursa (job #926369) | Cod sursa (job #986303) | Cod sursa (job #2467063) | Cod sursa (job #929835) | Cod sursa (job #393597)
Cod sursa(job #393597)
var f,g:text;
c:char;
k,l:longint;
ok,p:boolean;
begin
assign(f,'text.in');
reset(f);
k:=0;
l:=0;
ok:=true;
p:=true;
while not eof(f) do begin
read(f,c);
if (c=' ')and(k=0) then k:=0
else
if k=0 then k:=1;
if ((c=' ')and(ok=true))or(p=false) then begin
inc(k);
ok:=false;
p:=true;
end
else
if ((ord(c)>=65)and(ord(c)<=90))or((ord(c)>=97)and(ord(c)<=122)) then
begin
inc(l);
ok:=true;
p:=true;
end
else
p:=false;
end;
if (ok=false)and(c=' ') then dec(k);
close(f);
assign(g,'text.out');
rewrite(g);
writeln(g,l div k);
close(g);
end.