Cod sursa(job #525752)

Utilizator ion_calimanUAIC Ion Caliman ion_caliman Data 26 ianuarie 2011 01:55:18
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.45 kb
type litere=set of char;
var     c,b:char;
        a:litere;
        n,s:integer;
        f:text;

begin
  a:=['A'..'Z','a'..'z'];
  assign(f,'text.in');
  reset(f);
  n:=0;
  s:=0;
  c:=' ';
  while not eof(f) do
    begin
      b:=c;
      read(f,c);
      if c in a then inc(n) else if b in a then inc(s);
    end;
  close(f);

  if c in a then inc(s);

  assign(f,'text.out');
  rewrite(f);
  write(f,n div s);
  close(f);
end.