Pagini recente » Cod sursa (job #352885) | Cod sursa (job #1424751) | Cod sursa (job #2247072) | Cod sursa (job #113838) | Cod sursa (job #273445)
Cod sursa(job #273445)
program texts;
var f:text;
c:char;
nrc,nrl,hold:longint;
ok:boolean;
begin
nrl:=0; nrc:=0;
assign(f,'text.in');
reset(f);
while not eof(f) do begin
read(f,c);ok:=false;
case c of
'a'..'z': begin
inc(nrl);
ok:=true;
end;
'Z'..'Z': begin
inc(nrl);
ok:=true;
end;
end;
if not ok then inc(hold);
if ok and (hold>0) then begin
inc(nrc);
hold:=0;
end;
end;
close(f);
inc(nrc);
assign(f,'text.out');
rewrite(f);
write(f,nrl div nrc);
close(f);
end.