Pagini recente » Cod sursa (job #394378) | Cod sursa (job #826553) | Cod sursa (job #230162) | tema | Cod sursa (job #265689)
Cod sursa(job #265689)
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.