Cod sursa(job #37229)

Utilizator floringh06Florin Ghesu floringh06 Data 24 martie 2007 18:19:13
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.68 kb
{100 PUNCTE}
var fi,fo:text;
    nc,nl,rez:longword;
          ok:boolean;
           c:char;

 procedure solve;
   var i,k:longword;
    begin
     nc:=0;
     nl:=0;
     k:=0;
     while not eof(fi) do
      begin
        read(fi,c);
        if c in [('a')..('z'),('A')..('Z')] then
         begin
          inc(nl);
          if k=0 then inc(nc);
          k:=1;
         end
          else k:=0;
       end;
       if nc<>0 then  rez:=trunc(nl/nc)
            else rez:=0;
    end;





begin
 assign(fi,'text.in'); reset(fi);
 assign(fo,'text.out'); rewrite(fo);
 solve;
{ writeln(fo,nl);
 writeln(fo,nc);}
 writeln(fo,rez);
close(fi);
close(fo);
end.