#include <stdio.h>
#include<math.h>
int main()
{
float s(float x);
float f1,f2,f0;
float x1,x2,x0;
scanf("%f,%f",&x1,&x2);
f1=s(x1);
f2=s(x2);
if ((f1*f2)>0)
{
printf("please input number again:\n");
scanf("%f,%f",&x1,&x2);
f1=s(x1);
f2=s(x2);
}
else
{
do
{
x0=(x1+x2)/2;
f0=s(x0);
if((f0*f1)<0)
{
x2=x0;
f2=f0;
}
else
{
x1=x0;
f1=f0;
}
}
while(fabs(f0)<=1e-5);
}
printf("x=%f",x0);
return 0;
}
float s(float x)
{
float z;
z=(2*x*x*x)-(4*x*x)+(3*x)-6;
return (z);
}