Pagini recente » Cod sursa (job #182966) | Cod sursa (job #1015048) | Cod sursa (job #2467049) | Cod sursa (job #691546) | Cod sursa (job #906989)
Cod sursa(job #906989)
program text_infoarena;
type vect=array[1..1000000000] of char;
var v:vect;
i,j:longint; x,nrc,nrl:qword;
f,g:text;
function lit(c:char):boolean;
begin
lit:=false;
if ((c>='a')and(c<='z'))or((c>='A')and(c<='Z'))then lit:=true;
end;
begin
assign(f,'text.in');reset(f); //settextbuf(f,intrare);
assign(g,'text.out');rewrite(g); //settextbuf(g,iesire);
i:=1; nrl:=0; nrc:=0;
while not eoln(f) do
begin
read(f,v[i]);
if lit(v[i])then inc(nrl);
inc(i);
end;
for j:=1 to i do
if lit(v[j])and(not lit(v[j+1])) then inc(nrc);
x:=nrl div nrc;
writeln(g,x);
close(f); close(g);
end.