Cod sursa(job #128910)

Utilizator andumMorie Daniel Alexandru andum Data 28 ianuarie 2008 11:14:45
Problema Text Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
var k,q,c:integer;
    m:set of 'a'..'z';
    n:set of 'A'..'Z';
    f,g:text;
    a:array[1..10000] of char;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
q:=0;
c:=0;
k:=0;
m:=['a'..'z'];
n:=['A'..'Z'];
while not eof(f) do
      begin
      inc(q);
      read(f,a[q]);
      if a[q] in m+n then inc(k)
                     else if k>0 then inc(c);
      end;
write(g,k div c);
close(f);
close(g);
end.