Cod sursa(job #291306)

Utilizator FllorynMitu Florin Danut Flloryn Data 29 martie 2009 17:34:51
Problema Text Scor 70
Compilator fpc Status done
Runda The Beginners Marime 0.57 kb
program pascal;
var f,g:text; s:byte; nrcuv,nrl,z:int64;  c:char;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);

nrl:=0; nrcuv:=0;  s:=0;
while not seekeof(f) do
  begin
  read(f,c);
  z:=ord(c);
  if ((z>=65) and (z<=90)) or ((z>=97) and (z<=122)) then
            begin
               inc(nrl);
               s:=1;
            end
         else
        if s=1 then
           begin
           inc(nrcuv);
           s:=0;
           end;
  end;
 if s=1 then inc(nrcuv);
 z:=nrl div nrcuv;
write(g,z);
close(f);
close(g);
end.