Cod sursa(job #1650898)

Utilizator SaniokMDACaliman Alexandru SaniokMDA Data 11 martie 2016 21:25:26
Problema Text Scor 30
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
var
  s: string;
  i, j, x, y, z: longint;

begin
  assign(input, 'text.in');
  assign(output, 'text.out');
  reset(input);
  rewrite(output);
  x := 0;
  y := 0;
  read(s);
  for i := 1 to length(s) do 
  begin
    if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then x := x + 1;
    if (s[i] = ' ') and ((s[i + 1] in ['a'..'z']) or
    (s[i + 1] in ['A'..'Z'])) then 
      y := y + 1;
  end;
  y := y + 1;
  write(x div y);
end.