Cod sursa(job #1308483)

Utilizator wGEORGEWGeorge Cioti wGEORGEW Data 4 ianuarie 2015 08:48:20
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.48 kb
var
    f:text;
    c,p:char;
    l,n:integer;
begin
    assign(f,'text.in');
    reset(f);
    n:=0;l:=0;p:='.';
    while not eof(f) do begin
        read(f,c);
        if c in ['a'..'z','A'..'Z'] then
            l:=l+1
        else
            if p in ['a'..'z','A'..'Z']
                then n:=n+1;
        p:=c;
    end;
    close(f);
    if c in ['a'..'z','A'..'Z'] then n:=n+1;
    assign(f,'text.out');
    rewrite(f);
    write(f,l div n);
    close(f);
end.