不知道哪里错了,英语不是很好,调试问题在下面。
# include <stdio.h># include <conio.h>
# include <math.h>
main (void)
{
double a ,b ,d ,e ,x ;
int c;
printf ("请输入父亲的身高单位厘米");
scanf ("%lf",&a);
printf ("请输入母亲的身高单位厘米");
scanf ("%lf",&b);
printf ("男生请输入1,女生请输入2");
scanf ("%d", &c);
switch (c)
{
case 1:printf ("请输入男生自己的身高单位厘米");
scanf ("%lf",&d);
e=(a+b)*1.08 /2;
break;
case 2:printf ("请输入女生自己的身高单位厘米");
scanf ("%lf",&d);
e=(a*0.923+b)/2;
}
printf ("理论身高单位厘米=%lf",e);
x=e-d;
if (x<3,&x>-3)
printf ("结论符合公式");
else
printf ("结论不符公式");
getch();
return 0
}
:\安装文件\Microsoft Visual Studio\Common\MSDev98\Bin\Cpp1.cpp(44) : error C2446: '>' : no conversion from 'const int' to 'double *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
F:\安装文件\Microsoft Visual Studio\Common\MSDev98\Bin\Cpp1.cpp(44) : error C2040: '>' : 'double *' differs in levels of indirection from 'const int'
F:\安装文件\Microsoft Visual Studio\Common\MSDev98\Bin\Cpp1.cpp(55) : error C2143: syntax error : missing ';' before '}'
执行 cl.exe 时出错.
Cpp1.exe - 1 error(s), 0 warning(s)