Cod sursa(job #129307)

Utilizator andumMorie Daniel Alexandru andum Data 28 ianuarie 2008 22:19:10
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.8 kb
var k,c:longint;
    m:set of 'a'..'z';
    n:set of 'A'..'Z';   
    f,g:text;   
    p:boolean;   
    ch:char;   
begin  
assign(f,'text.in');   
assign(g,'text.out');   
reset(f);   
rewrite(g);   
c:=0;   
k:=0;   
m:=['a'..'z'];   
n:=['A'..'Z'];   
p:=false;
{while not eof(f) do begin}
while not eoln(f) do
      begin
      read(f,ch);
      if ch in m+n then begin
                        inc(k);
                        p:=false;
                        end
                   else if (k>0) and (not p) then begin
                                                  inc(c);
                                                  p:=true;
                                                  end;
{      if ch in m+n then p}
      end;   
write(g,k div c);   
close(f);   
close(g);   
end.