Cod sursa(job #236809)

Utilizator FllorynMitu Florin Danut Flloryn Data 28 decembrie 2008 15:41:25
Problema Text Scor 90
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.53 kb
program pascal;
var f,g:Text; nr,lung,p:int64; c:char;
procedure citire;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
nr:=0;
lung:=0;
p:=0;
while not eof(f) do
 begin
  read(f,c);
  if ((ord(c)>96) and (ord(c)<123)) or ((ord(c)>64) and (ord(c)<91)) then
      begin
       lung:=lung+1;
       p:=p+1;
      end
       else
       if p<>0 then
          begin
          nr:=nr+1;
          p:=0;
          end;
 end;
p:=lung div nr;
write(g,p);
close(f);
close(g);
end;

begin
citire;
end.