Pagini recente » Cod sursa (job #2460896) | Cod sursa (job #3151477) | Cod sursa (job #275937) | Cod sursa (job #388132) | Cod sursa (job #293909)
Cod sursa(job #293909)
var f,g:text;
lunglit,nrcuv:longint;
o,p:boolean;
i,x:char;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
lunglit:=0;
nrcuv:=0;
while not eof(f) do begin
p:=false;
read(f,x);
for i:='A' to 'Z' do if x=i then p:=true;
for i:='a' to 'z' do if x=i then p:=true;
if p then inc(lunglit)
else if (x=' ')or(x='-')and(lunglit<>0) then inc(nrcuv);
end;
o:=false;
for i:='A' to 'Z' do if x=i then o:=true;
for i:='a' to 'z' do if x=i then o:=true;
if not o then inc(nrcuv);
if (lunglit>0)and(nrcuv>0)then write(g,lunglit div nrcuv)
else write(g,0);
close(f);
close(g);
end.