Cod sursa(job #170632)

Utilizator betitebAntonia Haller betiteb Data 2 aprilie 2008 23:09:13
Problema Text Scor 70
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.52 kb
const m:set of char=['a'..'z','A'..'Z'];

var ct,S,d:longint;
    i,c1:char;
    f:text;
begin
assign(f,'text.in'); reset(f);
d:=0;
ct:=0; s:=0;
while (not eof(f)) do
begin
read(f,c1);
if eoln(f) then readln(f);
if [c1]*m<>[] then begin
d:=d+1;
inc(S);
end;
if (([c1]*m=[]) and (d<>0)) then begin inc(ct);
                                       d:=0;
                                 end;
end;
close(f);
assign(f,'text.out'); rewrite(f);
if ct=0 then writeln(f,'0')
else
writeln(f,S div ct);
close(f);
end.