Cod sursa(job #248513)
| Utilizator | Data | 25 ianuarie 2009 22:30:15 | |
|---|---|---|---|
| Problema | Text | Scor | 80 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
{text}
var f,g:text;
c:char;
cuv:string;
l,nr:longint;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
cuv:='';
while not eof(f) do
begin
read(f,c);
if upcase(c) in ['A'..'Z'] then cuv:=cuv+c
else begin
if cuv<>'' then
begin
l:=l+length(cuv);
inc(nr);
end;
cuv:='';
end;
end;
writeln(g,trunc(l/nr),' ');
close(f);
close(g);
end.