doube sum = 0; for ( int i = 1 ; i<=N;i++){ sum+=1.0/i; return sum; } 转载于:https://www.cnblogs.com/pn-hxj/p/10467660.html