Pagini recente » Cod sursa (job #1697604) | Cod sursa (job #456518)
Cod sursa(job #456518)
var i,n,k:longint;
s:string;
incepe:boolean;
f,g:text;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
readln(f,s);
n:=0;
k:=0;
incepe:=false;
for i:=1 to length(s) do
begin
if ((s[i]>='a') and (s[i]<='z')) or ((s[i]>='A') and (s[i]<='Z')) then
incepe:=true;
if (incepe=true) and ((s[i]=' ') or (s[i]='!') or (s[i]=',') or (s[i]='.') or (s[i]='?')or (s[i]='-')) then
begin
inc(k);
incepe:=false;
end;
if (incepe=true) then
inc(n);
end;
writeln(g,n div k);
close(f);
close(g);
end.