Cod sursa(job #557715)

Utilizator lsorin_94Lodoaba Sorin lsorin_94 Data 16 martie 2011 20:03:41
Problema Text Scor 60
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.47 kb
program doi;
var nrc,lung,n:longint;
    f,t:text;
    x:char;
begin
  assign(f,'text.in');
  reset(f);
  nrc:=0;lung:=0;
  while not seekeof(f) do
    begin
      read(f,x);
      if upcase(x) in ['A'..'Z','0'..'9'] then
        begin
          inc(lung);
          if n=0 then inc(nrc);
          n:=1;
        end
      else n:=0;
    end;
  close(f);
  {---------------}
  assign(t,'text.out');
  rewrite(t);
  write(t,lung div nrc);
  close(t);
end.