Cod sursa(job #178694)

Utilizator radupoenaruPoenaru Radu Constantin radupoenaru Data 14 aprilie 2008 22:08:33
Problema Text Scor 90
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.4 kb
const m:set of char=['a'..'z','A'..'Z'];
var nrl,nrc:integer;
    f:text;
    c,x:char;
begin
assign(f,'text.in');reset(f);
nrl:=0;
nrc:=0;
x:='-';
while not eof(f) do begin
      read(f,c);
      if c in m then inc(nrl)
                else if x in m then inc(nrc);
      x:=c;
      end;
close(f);   
assign(f,'text.out');rewrite(f);   
write(f,trunc(nrl/nrc));   
close(f)   
end.