Cod sursa(job #291536)

Utilizator b_ady20Branescu Adrian b_ady20 Data 29 martie 2009 23:09:23
Problema Text Scor 60
Compilator fpc Status done
Runda The Beginners Marime 0.63 kb
var lit,cuv:int64;
        l:char;
        f:text;
begin
lit:=0;
cuv:=0;
assign (f,'text.in');
reset (f);
read(f,l);
while (ord(l)<ord('a')) or (ord(l)>ord('z')) do
read(f,l);
if (ord(l)>=ord('a'))and(ord(l)<=ord('z')) then
lit:=1;
while not eof(f) do
begin
read (f,l);
if (ord (l)>=97) and (ord(l)<=122) then
inc (lit)
else
begin
while ((ord(l)<97)or(ord(l)>122))and(not eof(f)) do
read(f,l);
inc(cuv);
if (not eof(f))and((ord(l)>=97)and(ord(l)<=122)) then
inc (lit);
end;
end;
if (ord(l)>=97)and(ord(l)<=122) then
inc(cuv);
close (f);
assign (f,'text.out');
rewrite (f);
write (f,lit div cuv);
close (f);
end.