代码: #includeint main() { int i; double sum = 0; for (i = 1; i < 100; i++) { sum = i / (i + 1.0); } printf("sum = %lf\n", sum); return&酣钉丰固莶改奉爽斧鲸nbsp;0; }12-22=(1-2)×(1+2)=-(1+2)32-42=(3-4)×(3+4)=-(3+4)以此类推,原式=-(1+2+3+4+...+100)=-5050原式=(12-22)+(32-42)+……+(992-1002)=(1+2)(1-2)+(3+4)(3-4)+……+(99+100)(99-100)=(1+2)*(-1)+(3+4)*(-1)+……+(99+100)*(-1)第二个括号都是-1所以=(-1)*(1+2+3+4+……+99+100)=-505012-22+32-42+52-62+…+992-1002=(1+2)(1-2)+(3+4)(3-4)+...+(99+100)(99-100)=-1-2-3-4-...-99-100=-(1+2+...+100)=-100×(1+100)÷2=-5050;12-22+32-42+52-62+…+992-1002=(12-22)+(32-42)+(52-62)+…+(992-1002)=(1-2)(1+2)+(3-4)(3+4)+…+(99-100)(99+100)=-1-2-3-4-……-99-100=-5050