Cod sursa(job #289151)

Utilizator b_ady20Branescu Adrian b_ady20 Data 26 martie 2009 15:08:36
Problema Text Scor 100
Compilator fpc Status done
Runda aa Marime 0.83 kb
var lit,cuv:int64;
    l:char;
begin
lit:=0;
cuv:=0;
assign (input,'text.in');
reset (input);
read(input,l);
while (ord(l)<97)and(ord(l)>90)or(ord(l)>122)or(ord(l)<65) do
read(input,l);
if(ord(l)>=ord('a'))and(ord(l)<=ord('z'))or(ord(l)>=ord('A'))and(ord(l)<=ord('Z'))then
lit:=1;
while not eof(input) do
begin
read (input,l);
if (ord (l)>=97)and(ord(l)<=122)or(ord(l)>=65)and(ord(l)<=90)then
inc (lit)
else
begin
while ((ord(l)<97)and(ord(l)>90)or(ord(l)>122)or(ord(l)<65))and(not eof(input))do
read(input,l);
inc(cuv);
if (not eof(input))and((ord(l)>=97)and(ord(l)<=122)or(ord(l)>=65)and(ord(l)<=90)) then
inc (lit);
end;
end;
if (ord(l)>=97)and(ord(l)<=122)or(ord(l)>=65)and(ord(l)<=90) then
inc(cuv);
close (input);
assign (output,'text.out');
rewrite (output);
write (output,lit div cuv);
close (output);
end.