Cod sursa(job #1300550)

Utilizator wGEORGEWGeorge Cioti wGEORGEW Data 24 decembrie 2014 16:12:59
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
var
    f:text;
    c,p:char;
    l,n:integer;
begin
    assign(f,'text.in');
    reset(f);
    n:=0;
    l:=0;
    p:=' ';
    while not eoln(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.