Cod sursa(job #265687)

Utilizator yoannaserb ioana yoanna Data 24 februarie 2009 11:44:53
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.41 kb
var s:string;
    i,nr,cuv:integer;
    f,g:text;
begin
assign(f,'text.in'); reset(f);
nr:=0;
cuv:=0;
i:=0;
while not eoln(f) do
begin
read(f,s[i]);
if (s[i]>='A') and (s[i]<='z') then
nr:=nr+1;
inc(i);
end;
i:=1;
while i<=length(s) do
begin
inc(i);
if s[i]=' ' then
cuv:=cuv+1;
end;
assign(g,'text.out');
rewrite(g);
write(g,'Lungimea medie=',nr div (cuv+1));
close(g);
readln
end.