A-A+

下列程序的运行结果为【 】。 include<math.h> include<stdio.h

2022-08-12 18:56:05 问答库 阅读 197 次

问题详情

下列程序的运行结果为【 】。 include<math.h> include<stdio.h> main() { int s=1; float n=1,pi=0; double t=1; while(fabs(t)>=2e-6) { pi+=t; n+=2; s=-s; t=s/n; } pi*=4; printf("pi=%.6fn",pi); }


请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:3.141592
141592

考点:结果,程序