Cod sursa(job #234714)

Utilizator RobybrasovRobert Hangu Robybrasov Data 21 decembrie 2008 20:16:45
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.51 kb
const mic:set of char=['a'..'z'];
      mare:set of char=['A'..'Z'];
var c:char;
    cuv,l:longint;

begin
  assign(input,'text.in');
  assign(output,'text.out');
  reset(input); rewrite(output);
  while not eof(input) do
    begin
      read(c);
      if (c in mic) or (c in mare) then inc(cuv);
      while (c in mic) or (c in mare) do
        begin
          read(c);
          inc(l);
        end;
    end;

  if cuv>0 then write(l div cuv) else write(cuv);

  close(input);
  close(output);

end.