Cod sursa(job #1051184)

Utilizator vyrtusRadu Criuleni vyrtus Data 9 decembrie 2013 19:52:51
Problema Text Scor 50
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.7 kb
Program text_infoarena;
  const lmic=['a'..'z']; lmare=['A'..'Z'];
var  f,g:text;
  i,l,k:longint;
   c:char;
    ok:boolean;

BEGIN
   assign(f,'text.in'); reset(f);
   assign(g,'text.out'); rewrite(g);

      l:=0; k:=1; ok:=false;
     while (not(eof(f))) do
      begin
        read(f,c);
        if ((c in lmic) or (c in lmare)) then inc(l);
        if (((c in lmic) or (c in lmare)) and (not(ok)))
         then
          begin
            ok:=true;
            inc(k);
          end;
       if (not((c in lmic) or (c in lmare)) and (ok))
         then
          begin
            ok:=false;
          end;
      end;

      writeln(g,trunc(l/k));
   close(f); close(g);
END.