Pagini recente » Cod sursa (job #2121120) | Cod sursa (job #677932) | Cod sursa (job #1752724) | Cod sursa (job #1066432) | Cod sursa (job #175137)
Cod sursa(job #175137)
Program texte;
var s: string;
nc,nt,q,i: longint;
t,f: text;
Begin
assign(t,'text.in'); reset(t);
read(t,s);
close(t);
nc:=0;
nt:=0;
q:=0;
for i:=1 to length(s) do
begin
if s[i] in ['a'..'z']+['A'..'Z'] then begin
q:=1;
nt:=nt+1;
end
else if q<>0 then
begin
nc:=nc+1;
q:=0;
end;
end;
if s[length(s)] in ['a'..'z']+['A'..'Z'] then nc:=nc+1;
if (q=1) and (nc=0) then nc:=nc+1;
assign(f,'text.out'); rewrite(f);
write(f,nt div nc);
close(f);
end.