Pagini recente » Cod sursa (job #641607) | Cod sursa (job #2882125) | Cod sursa (job #1117390) | Cod sursa (job #2166658) | Cod sursa (job #273442)
Cod sursa(job #273442)
program texts;
var f:text;
c:char;
nrc,nrl:longint;
ok:boolean;
begin
nrl:=0; nrc:=0;
ok:=false;
assign(f,'text.in');
reset(f);
while not eof(f) do begin
read(f,c);
case c of
'a'..'z': inc(nrl);
'A'..'Z': inc(nrl);
end;
if (c=' ')and not ok then begin
inc(nrc);
ok:=true;
end
else ok:=false;
end;
close(f);
inc(nrc);
assign(f,'text.out');
rewrite(f);
write(f,nrl div nrc);
close(f);
end.