Pagini recente » Cod sursa (job #2354464) | Cod sursa (job #1937372) | Cod sursa (job #2485854) | Cod sursa (job #2143558) | Cod sursa (job #758544)
Cod sursa(job #758544)
program textaha;
var f,g:text;
s:ansistring;
i,litere,cuvinte:longint;
begin
assign (f,'text.in'); reset (f);
assign (g,'text.out'); rewrite (g);
read (f,s);
litere:=0;
cuvinte:=0;
for i:=1 to length (S) do
begin
if (s[i]>='A') and (s[i]<='z') then
inc(litere);
if (i<>1) and ((s[i]<'A') or (s[i]>'z')) and ((s[i-1]>='A') and (s[i-1]<='z')) then
inc(cuvinte);
end;
if (s[length (s)]>='A') and (s[length(s)]<='z') then
inc(cuvinte);
if cuvinte=0 then
write (g,0)
else
write (G,trunc(litere/cuvinte));
close (F); close (G);
end.