Pagini recente » Cod sursa (job #3165994) | Cod sursa (job #346682) | Cod sursa (job #2864234) | Cod sursa (job #3002211) | Cod sursa (job #506990)
Cod sursa(job #506990)
var cuv:string;
c:char;
j,s,x:integer;
f,g:text;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
cuv:='';
j:=0;
s:=0;
while not eof(f) do
begin
read(f,c);
if ((c>='A') and (c<='Z') or (c>='a') and (c<='z')) then
begin
cuv:=cuv+c;
inc(s);
end
else if cuv<>'' then
begin
inc(j);
cuv:='';
end;
end;
if cuv<>'' then inc(j);
x:=s div j;
writeln(g,x);
close(f);
close(g);
end.