Cod sursa(job #153413)

Utilizator ghitza_2000Stefan Gheorghe ghitza_2000 Data 10 martie 2008 15:18:18
Problema Text Scor 80
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.61 kb
var ct,S,d:integer;
    i,c1:char;
    f,g:text;
    m:set of char;
begin
assign(f,'text.in'); reset(f);
m:=[];
for i:='a' to 'z' do
m:=m+[i];
d:=0;
ct:=0; s:=0;
for i:='A' to 'Z' do
m:=m+[i];
while (not eof(f)) do
begin
read(f,c1);
if (([c1]*m<>[]) and (eoln(f))) then inc(ct);
if eoln(f) then readln(f);
if [c1]*m<>[] then begin
inc(d);
inc(S);   
end;   
if (([c1]*m=[]) and (d<>0)) then begin inc(ct);   
                                       d:=0;   
                                 end;   
end;   
close(f);   
assign(g,'text.out'); rewrite(g);   
writeln(g,S div ct);   
close(g);   
end.