#include#include,main(){int s;float n,t,p;t=1.0;p=0;n=1.0;s=

#include
#include,
main()
{int s;
float n,t,p;
t=1.0;
p=0;
n=1.0;
s=1;
while(fabs(t)>=1e-6);
{p=p+t;
n+=2.0
s=-s;
t=s/n;
}
p=4*p;
pintf("p=%fn",p);
}
最后怎么输出--------------------Configuration:Cpp1 - Win32 Debug--------------------
Compiling...
Error spawning cl.exe
Cpp1.obj - 1 error(s),0 warning(s) 到底是哪里出错了啊
生活诗人 1年前 已收到1个回答 举报

sjlin 幼苗

共回答了15个问题采纳率:93.3% 举报

第二行多个逗号,while那一行最后的分号去掉!

1年前 追问

1

生活诗人 举报

改回来了 还是错误啊 还有哪里有问题吗 麻烦帮我看看 谢了啊 #include #include main() {int s; float n,t,p; t=1.0; p=0; n=1.0; s=1; while(fabs(t)>=1e-6) {p=p+t; n+=2.0; s=-s; t=s/n; } p=4*p; pintf("p=%fn",p); }

举报 sjlin

while(fabs(t)>=1e-6) 更改为while(fabs(t)>=1*e-6)

生活诗人 举报

怎么还是错误啊 郁闷
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 18 q. 0.074 s. - webmaster@yulucn.com