Cod sursa(job #867831)

Utilizator infinitiInfiniti infiniti Data 30 ianuarie 2013 10:48:57
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.45 kb
program asd;
var c,cb : char;
    f : text;
    lit,cuv : real;

begin
    cb := ' ';
    assign(f,'text.in'); reset(f);
    while not eoln(f) do begin
        read(f,c);
        if (cb = ' ') and (c <> ' ') then cuv := cuv+1;
        if ((c >= 'a') and (c <= 'z')) or ((c >= 'A') and (c <= 'Z'))
            then lit := lit +1;
        cb := c;
        end;
    assign(f,'text.out'); rewrite(f);
    write(f,trunc(lit/cuv));
    close(f);
end.