Cod sursa(job #168393)

Utilizator loriKis Levente Lorand lori Data 31 martie 2008 11:37:15
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.49 kb
var i,l,ls,c:longint;
    s:string;
begin
 assign(input,'text.in'); reset(input);
 assign(output,'text.out'); rewrite(output);
 readln(s);
 for i:=1 to length(s) do begin
  if ((ord(s[i])>64) and (ord(s[i])<91)) or ((ord(s[i])>96) and (ord(s[i])<123)) then begin
   inc(l); inc(ls);
  end
                else begin
   if ls>0 then inc(c);
   ls:=0;
  end;
 end;
 if ls>0 then inc(c);
 if c=0 then writeln(0)
        else writeln(trunc(l/c));
 close(input); close(output);
end.