错误 erroe 2447 如何修改
#include<stdio.h>#include<math.h>
float x1,x2;
double p,q,di;
greater_than_zero(float a,float b);
{
x1=(-b+sqrt(di))/(2*a);
x2=(-b-sqrt(di))/(2*a);
}
equal_to_zero(float a,float b);
{
x1=x2=-b/(2*a);
}
smaller_than_zero(float a, float b);
{
p=-b/(2*a);
q=sqrt(-di)/(2*a);
}
main()
{
float a,b,c;
printf("请输入方程的各项系数");
scanf("%f,%f,%f",&a,&b,&c);
printf("方程%6.3fx*x+%6.3fx+%6.3f=0的解为:\n",a,b,c);
di=b*b-4*a*c;
if(di>0)
{
greater_than_zero(a,b);
printf("x1=%6.3f,x2=%6.3f\n",x1,x2);
}
if(di=0)
{
equal_to_zero(a,b);
printf("x1=x2=%6.3f\n",x1);
}D:\新建文件夹\Microsoft Visual Studio\MyProjects\求根程序\求根.cpp(7) : error C2447: missing function header (old-style formal list?)
D:\新建文件夹\Microsoft Visual Studio\MyProjects\求根程序\求根.cpp(13) : error C2447: missing function header (old-style formal list?)
D:\新建文件夹\Microsoft Visual Studio\MyProjects\求根程序\求根.cpp(18) : error C2447: missing function header (old-style formal list?)