#include<stdio.h>int main(){ int sign=1; int n=1,term=1.0; double sum=0.0; while(n<=100) { sum+=term; n=n+2; sign=-sign; term=sign/n; } printf("sum=%lf\n",sum); return 0;}
4 回答
已采纳
KanoWill
TA贡献8条经验 获得超1个赞
#include<stdio.h> int main() { float sign=1,term=1; int n=1; double sum=0.0; while(n<=100) { sum+=term; n=n+2; sign=-sign; term=sign/n; } printf("sum=%lf\n",sum); return 0; } //帮你改后的全代码
- 4 回答
- 0 关注
- 1353 浏览
添加回答
举报
0/150
提交
取消