Cod sursa(job #4927)

Utilizator vanila0406Ionescu Victor vanila0406 Data 8 ianuarie 2007 21:39:51
Problema Text Scor 90
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.93 kb
program texte;
var f,g:text;
   l:qword;
        sl,nc:qword;



procedure iofile;
begin
        assign(f,'text.in');
        reset(f);
        assign(g,'text.out');
        rewrite(g);
        l:=0;
end;


procedure prel;
var c:char;
begin
        sl:=0;
        nc:=0;
        while not eof(f) do
                begin
                        read(f,c);
                        if (c in ['a'..'z']) or (c in['A'..'Z']) then
                                inc(l) else
                                if l<>0 then
                                        begin
                                                sl:=sl+l;
                                                inc(nc);
                                                l:=0;
                                        end;
                end;
        close(f);
        writeln(g,trunc(sl/nc));
        close(g);
end;


begin
        iofile;
        prel;
end.