fabs(t)>le# include <stdio.h># include <math.h>void main(){ int s; float n,t,pi; t=1; pi=0; s=1; n=1.0; while(fabs(t)>le-6) { pi=pi+t; n=n+2; s=-s; t=s/n; } pi=pi*4; printf("%f",pi); getch();}用WIN -TC编译结果是 错误
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 14:37:59
fabs(t)>le# include <stdio.h># include <math.h>void main(){ int s; float n,t,pi; t=1; pi=0; s=1; n=1.0; while(fabs(t)>le-6) { pi=pi+t; n=n+2; s=-s; t=s/n; } pi=pi*4; printf("%f",pi); getch();}用WIN -TC编译结果是 错误
fabs(t)>le
# include <stdio.h># include <math.h>void main(){ int s; float n,t,pi; t=1; pi=0; s=1; n=1.0; while(fabs(t)>le-6) { pi=pi+t; n=n+2; s=-s; t=s/n; } pi=pi*4; printf("%f",pi); getch();}用WIN -TC编译结果是 错误 未定义的符号'le'在 main 函数中 为什么?哪里错了?
fabs(t)>le# include <stdio.h># include <math.h>void main(){ int s; float n,t,pi; t=1; pi=0; s=1; n=1.0; while(fabs(t)>le-6) { pi=pi+t; n=n+2; s=-s; t=s/n; } pi=pi*4; printf("%f",pi); getch();}用WIN -TC编译结果是 错误
傻孩子,你le-6打错了 我猜了好久才知道你是要用科学表示法,你把“1”输成l了,还有,用科学表示法,需要注意两点:1 e前必须有数字;2 e后必须是整数··