Cod sursa(job #866772)

Utilizator lolmanDomuta Dariu lolman Data 28 ianuarie 2013 19:02:26
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.47 kb
var f,g:text;
    lit: char;
    ok: boolean;
    l,cuv:integer;
    x:real;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
while not(eof(f)) do
 begin
   read(f,lit);
   if ((lit>='A') and (lit<='Z')) or ((lit>='a') and (lit<='z')) then
       begin
        l:=l+1;
        ok:=true;
       end
   else
      begin
       if ok then cuv:=cuv+1;
       ok:=false;
      end;
 end;
x:=l/cuv;
write(g,trunc(x));
close(f);
close(g);
end.