Cod sursa(job #13724)

Utilizator floringh06Florin Ghesu floringh06 Data 7 februarie 2007 13:57:37
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.67 kb
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.