Pagini recente » Cod sursa (job #2908637) | Cod sursa (job #2239401) | Cod sursa (job #2573509) | Cod sursa (job #2033592) | Cod sursa (job #143298)
Cod sursa(job #143298)
program textul;
var f,g:text;
c1,c2:char;
lung,cuv,m:word;
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,c1,c2);
lung:=2;
cuv:=0;
while not (eof(f)) do
begin
if (litera(c1)=true) and (litera(c2)=false) then inc(cuv);
c1:=c2;
read(f,c2);
inc(lung);
end;
m:= lung div cuv;
write(g,m);
close(f);
close(g);
end.