Cod sursa(job #53139)
Utilizator | Data | 21 aprilie 2007 10:45:28 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.67 kb |
var s:string;
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;
readln(fi,s);
s[length(s)+1]:=' ';
for i:=1 to length(s)+1 do
begin
if s[i] in ['a'..'z','A'..'Z'] then inc(ct)
else begin
if ct>0 then inc(ctcuv);
suma:=suma+ct;
ct:=0; end;
end;
rez:=suma div ctcuv;
writeln(fo,rez);
close(fi); close(fo);
end.