Cod sursa(job #672300)

Utilizator dutzu93Vlad Vedinas dutzu93 Data 1 februarie 2012 20:41:22
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.48 kb
var
    s,n:integer;
    ok:boolean;
    ch:char;
    fi,fo:text;

begin
    assign(fi, 'text.in');reset(fi);
    assign(fo, 'text.out');reset(fo);
    while not eof(fi) do begin
        read(fi,ch);
        if (ch>='a') and (ch<='z') or (ch>='A') and (ch<='Z') then begin
            inc(s);
            ok:=true;
        end else if ok then begin
            inc(n);
            ok:=false;
        end;
    end;
    writeln(fo,s div n);
close(fi);
close(fo);
end.