Cod sursa(job #1051191)

Utilizator vyrtusRadu Criuleni vyrtus Data 9 decembrie 2013 19:57:53
Problema Text Scor 50
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.59 kb
Program text_infoarena;
  const lmic=['a'..'z']; lmare=['A'..'Z'];
var  f,g:text;
  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
         begin
         inc(l);
        if (not(ok)) then
          begin
            ok:=true;
            inc(k);
          end;
         end
          else ok:=false;

      end;

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