Pagini recente » Monitorul de evaluare | Diferente pentru utilizator/stargold2 intre reviziile 275 si 265 | Monitorul de evaluare | Istoria paginii utilizator/yochinezu | Cod sursa (job #88894)
Cod sursa(job #88894)
var f1,f2:text;
lc,nc,i:longint;
t,q:char;
begin
assign(f1,'text.in');
assign(f2,'text.out');
reset(f1);
rewrite(f2);
nc:=0;lc:=0;
{numar de litere}
while not eof(f1) do
begin
read(f1,t);
if ((t>='a') and (t<='z')) or ((t>='A') and (t<='Z')) then inc(lc);
end;
{numar de cuvinte}
reset(f1);
read(f1,t);
if ((t>='a') and (t<='z')) or ((t>='A') and (t<='Z')) then inc(nc);
while not eof(f1) do
begin
read(f1,q);
if (((q>='a') and (q<='z')) or ((q>='A') and (q<='Z'))) and
(not(t in ['a'..'z'])) and (not(t in ['A'..'Z'])) then inc(nc);
t:=q;
end;
if (lc<>0) and (nc=0) then nc:=nc+1;
if nc=0 then writeln(f2,0)
else writeln(f2,lc div nc);
close(f1);
close(f2);
end.