Cod sursa(job #151152)

Utilizator radupointMircea Radu-Viorel radupoint Data 7 martie 2008 20:56:27
Problema Text Scor 90
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.58 kb
program textcuv;
 const
      alfabet=['a'..'z','A'..'Z','0'..'9'];
 var
    f:text;
    ch:char;
    c,l:longint;
begin
 assign(f,'text.in');
 reset(f);
  l:=0;
  c:=0;
  read(f,ch);
 while not eof(f) do
  begin
   while not eoln(f) do
    begin
     while not (ch in alfabet) do
      read(f,ch);
       if not eoln(f) then
        inc(c);
       while ch in alfabet do
        begin
         read(f,ch);
         inc(l);
        end;
    end;
    readln(f);
  end;
     close(f);
 assign(f,'text.out');
 rewrite(f);
  write(f,int(l/c):0:0);
 close(f);
end.