Pagini recente » Cod sursa (job #129395) | Cod sursa (job #2897147) | Cod sursa (job #2503066) | Cod sursa (job #2173735) | Cod sursa (job #144036)
Cod sursa(job #144036)
program textul;
var f,g:text;
c1,c2:char;
lung,cuv,m:longint;
function litera(x:char):boolean;
begin
if ((x>='a') and (x<='z'))or((x>='A') and (x<='Z')) then litera:=true
else litera:=false;
end;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
read(f,c2); {primul caracter}
lung:=0;
if litera(c2) then inc(lung);
cuv:=0;
repeat
c1:=c2;
read(f,c2);
if (litera(c1)=true) and (litera(c2)=false) then inc(cuv);
if litera(c2) then inc(lung);
until {(c2='.') or (c2='?')or (c2='!')or} eof(f);
if cuv<>0 then m:= lung div cuv
else m:=0;
write(g,m);
close(f);
close(g);
end.