Cod sursa(job #506986)

Utilizator tudorsTudor Siminic tudors Data 5 decembrie 2010 13:31:26
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.84 kb
var cuv:string;
c:char;
i,j,s:integer;
f,g:text;
begin
        assign(f,'text.in');
        reset(f);
        assign(g,'text.out');
        rewrite(g);
        cuv:='';
        j:=0;
        s:=0;
        while not eoln(f) do
                begin
                        read(f,c);
                        if ((c>='A') and (c<='Z') or (c>='a') and (c<='z')) then
                                begin
                                        cuv:=cuv+c;
                                        inc(s);
                                end
                        else if cuv<>'' then
                                begin
                                        inc(j);
                                        cuv:='';
                                end;
                end;
        writeln(s div j);
        readln;
end.