Cod sursa(job #302296)

Utilizator costyv87Vlad Costin costyv87 Data 8 aprilie 2009 19:55:52
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.4 kb
var s,cuv,con:qword;
    c:char;   f,g:text;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
cuv:=0;
s:=0;
while not eoln(f) do begin
read(f,c);
if (c in ['a'..'z']) or (c in ['A'..'Z']) then begin
inc(cuv);
con:=0;
while not (eoln(f)) and ((c in ['a'..'z']) or (c in ['A'..'Z'])) do begin inc(con); read(f,c); end;
s:=s+con;
end;
end;
write(g,s div cuv);
close(g);
end.