Cod sursa(job #602990)
Utilizator | porcescu gicu gicu_01 | Data | 13 iulie 2011 23:37:01 |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
var s,p,k:int64;
procedure citire;
var c:char;f:text;
begin
assign(f,'text.in');
reset(f);
k:=0;p:=0;s:=0;
while not eof(f) do
begin
read(f,c);
if ((ord(c)>=65)and(ord(c)<=90))or((ord(c)>=97)and(ord(c)<=122)) then begin inc(s); inc(p);end else
if p>0 then begin inc(k); p:=0; end;
end;
if p>0 then inc(k);
close(f);
end;
procedure afis;
var f:text;
begin
assign(f,'text.out');
rewrite(f);
writeln(f,s/k);
close(f);
end;
begin
citire;
afis;
end.