#include#include,main(){int s;float n,t,p;t=1.0;p=0;n=1.0;s=
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/08 06:07:47
#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=%f\n",p);
}
最后怎么输出--------------------Configuration:Cpp1 - Win32 Debug--------------------
Compiling...
Error spawning cl.exe
Cpp1.obj - 1 error(s),0 warning(s) 到底是哪里出错了啊
#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=%f\n",p);
}
最后怎么输出--------------------Configuration:Cpp1 - Win32 Debug--------------------
Compiling...
Error spawning cl.exe
Cpp1.obj - 1 error(s),0 warning(s) 到底是哪里出错了啊
第二行多个逗号,while那一行最后的分号去掉!
再问: 改回来了 还是错误啊 还有哪里有问题吗 麻烦帮我看看 谢了啊 #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=%f\n",p); }
再答: while(fabs(t)>=1e-6) 更改为while(fabs(t)>=1*e-6)
再问: 怎么还是错误啊 郁闷
再问: 改回来了 还是错误啊 还有哪里有问题吗 麻烦帮我看看 谢了啊 #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=%f\n",p); }
再答: while(fabs(t)>=1e-6) 更改为while(fabs(t)>=1*e-6)
再问: 怎么还是错误啊 郁闷
#include#include,main(){int s;float n,t,p;t=1.0;p=0;n=1.0;s=
#include main() {int s,n; float pi=0,t; t=float(s)/n; for(s=
#include #include { int p=1;float eps,n=1.0,t=1,pi=0; eps=1*
#include #define M 20; void main() { int i,j,k,p,t,n=0; int
#include main() { float a,n,i,j,s; scanf("%d",&a); for(n=1.0
#include void main() {float P,r=0.1;int n=10; P=(1+r)^n; pri
#include main(){ int n,s;n=s=0;while(s
#include main() { int w; float n,i,r; scanf("%f",&n); w=0; i
#include #include void main() { long s,t,sl=1; int d; //clrs
#include main() { char *p="abcde\ofghjik\0"; printf("%d\n",s
# include # include int mian () { int m,n,i,s=0; int a[10000
#include main(){char s[]="012xyz\08s34f4w2"; int i,n=0; for(