Cod sursa(job #121627)

Utilizator mlazariLazari Mihai mlazari Data 9 ianuarie 2008 10:17:28
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
Program PText;
var c1,c2 : char;
    n,l : longint;
    f : text;
begin
  n:=0;
  l:=0;
  c1:='*';
  assign(f,'text.in');
  reset(f);
  while not eof(f) do
   begin
     read(f,c2);
     if (c2 in ['A'..'Z','a'..'z']) then
      begin
        l:=l+1;
        if not (c1 in ['A'..'Z','a'..'z']) then n:=n+1;
      end;
     c1:=c2;
   end;
  close(f);
  assign(f,'text.out');
  rewrite(f);
  write(f,l div n);
  close(f);
end.