编辑: yyy888555 | 2019-07-06 |
2 ? 计算新的当前项item = num / den pi = pi *
4 输出pi * 3.4.1 while语句举例(编程实现) ......double pi = 0.0;
int num = 1;
int den = 1;
double item = 1.0;
while(fabs(item) > 1e-6) { pi = pi + item;
num = -num;
den = den + 2;
item = (double)num / den;
}pi = pi * 4;
cout