Cod sursa(job #302301)

Utilizator costyv87Vlad Costin costyv87 Data 8 aprilie 2009 19:57:20
Problema Text Scor 80
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.45 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 eof(f) do begin
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;
readln(f);
end;
write(g,s div cuv);
close(g);
end.