Pagini recente » Cod sursa (job #1607542) | Monitorul de evaluare | Cod sursa (job #1385278) | Cod sursa (job #174494) | Cod sursa (job #604951)
Cod sursa(job #604951)
program cuvinte;
var
ch:set of char;
s:string;
i,l,c:integer;
f,g:text;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
read(f,s);
close(f);
ch:=['a'..'z','A'..'Z'];
for i:=1 to length(s) do
begin
if s[i] in ch then
inc(l);
if ((s[i]=' ') or (s[i]='-')) and (i<>1) then
inc(c);
if (i=1) and (s[i]<>' ') and (s[i]<>'-') then
inc(c);
end;
rewrite(g);
writeln(g,l div c);
close(g);
end.