Cod sursa(job #604972)

Utilizator Andru_Andru Felipe Zuniga Andru_ Data 26 iulie 2011 12:47:44
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.43 kb
program cuvinte;
var
 ch:set of char;
 s:string;
 i,l,c:integer;
 f,g:text;
begin
 assign(f,'text.in');
 assign(g,'text.out');
 reset(f);
 read(f,s);
 close(f);
 ch:=['a'..'z','A'..'Z'];
 for i:=1 to length(s) do
  begin
   if s[i] in ch then
    inc(l);
   if ((s[i] in [chr(0)..chr(127)]-ch) and not (s[i+1] in [chr(0)..chr(127)]-ch)) or (i=1) then
    inc(c);
  end;
 rewrite(g);
 write(g,l div c);
 close(g);
end.