Cod sursa(job #338660)

Utilizator idomiralinIdomir Alin idomiralin Data 6 august 2009 14:06:41
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.54 kb
var a:string;
    f1,f2:text;
    ct,ct1,i:integer;

begin

    assign(f1,'text.in');
    reset(f1);
    assign(f2,'text.out');
    rewrite(f2);
    ct:=0;
    ct1:=0;
    while not(eof(f1)) do
    begin
    read(f1,a);

        for i:=1 to length(a) do
        begin
        if (a[i] in ['a'..'z']) or (a[i] in  ['A'..'Z']) then inc(ct)

                 else if (a[i-1] in ['a'..'z']) or (a[i-1] in ['A'..'Z']) then inc(ct1);
        end;
    end;
        writeln(f2,ct div (ct1-1));

        close(f1);
        close(f2);

end.