Cod sursa(job #593940)

Utilizator teban.mihaiTeban Mihai Andrei teban.mihai Data 5 iunie 2011 15:45:49
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.48 kb
var s:char;
    l,nr,i:longint;
    f,g:text;
begin
  assign(f,'text.in');
  reset(f);
  assign(g,'text.out');
  rewrite(g);
  l:=0;
  nr:=0;
  while not eof(f) do
  begin
    read(f,s);
    if ((s>='a') and (s<='z')) or ((s>='A') and (s<='Z')) then
    begin
      inc(nr);
      while ((s>='a') and (s<='z')) or ((s>='A') and (s<='Z')) do
      begin
        inc(l);
        read(f,s);
      end;
    end;
  end;

  writeln(g,l div nr);
  close(f);
  close(g);
end.