Cod sursa(job #525741)

Utilizator ion_calimanUAIC Ion Caliman ion_caliman Data 26 ianuarie 2011 01:21:53
Problema Text Scor 70
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.42 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:=1;
  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);

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