Pagini recente » Cod sursa (job #2553527) | simulare_oji_sergiu_2 | Rating Alex T (AlexTunea) | Cod sursa (job #1996232) | Cod sursa (job #274764)
Cod sursa(job #274764)
program texts;
var f:text;
c:char;
nrc,nrl,hold:longint;
ok:boolean;
procedure scriere;
begin
case c of
'a'..'z': begin
inc(nrl);
ok:=true;
end;
'A'..'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;
begin
nrl:=0; nrc:=0;
assign(f,'text.in');
reset(f);
read(f,c); scriere;
if ok=true then inc(nrc);
while not eof(f) do begin
read(f,c);ok:=false;
scriere;
end;
close(f);
assign(f,'text.out');
rewrite(f);
if nrl<>0 then begin
write(f,nrl div nrc);
end
else write(f,0);
close(f);
end.