program sum(output); var s,a:real; n:integer; begin s:=1.0;n:=0 repeat ( n:=n+1 ); a:=1/( (n*(n+1)) ); s:s+a until n=29; wrileln('n=',n:2;s=',s:6:3) end. 程序运行结果: