
大家帮帮看看吧 ,小弟 谢谢了

1.求倒数之和;
求1+1/2+1/3+...+1/i 的函数rsun().
以i=10为例.
结果:
Sum=1+1/2+...+1/10=2.928968
To find the sum of 1+1/2+...+1/N
Enter integer N? 100
sum=1+1/2+...+1/100=5.187378
2.register变数的应用
函数func(i) 是求 1+2+3+...+i 的和的函数,
求func(1)+func(2)+...func(20)的值.
结果:
sum of (1+...+10)+(1+...+11)+...+(1+...+20)=1375