Cod sursa(job #53144)
| Utilizator | Data | 21 aprilie 2007 11:03:32 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.7 kb |
var s:char;
fi,fo:text;
ct,suma,ctcuv,rez,i:longint;
begin
assign(fi,'text.in'); reset(fi);
assign(fo,'text.out'); rewrite(fo);
ct:=0; ctcuv:=0; suma:=0;
while not eof(fi) do
begin
read(fi,s);
if s in ['a'..'z','A'..'Z'] then inc(ct)
else begin
if ct>0 then inc(ctcuv);
suma:=suma+ct;
ct:=0; end;
end;
if ct<>0 then begin suma:=suma+ct; inc(ctcuv); end;
rez:=suma div ctcuv;
writeln(fo,rez);
close(fi); close(fo);
end.
