#include <stdio.h>
#include <math.h>
double func (double x);
double df (double x);
int main()
{
double x0,x1;
double delta=1.0e-5;
x0=0.5;
for(;;){
x1=x0-func(x0)/df(x0);
if(fabs(func
(x1
))<delta
){ break;
}
else{
x0=x1;
}
}
return 0;
}
double func(double x){
double y;
y=x*x*x*x*x-30*x*x*x*x+300*x*x*x-1200*x*x+1800*x-720;
return y;
}
double df(double x){
double y;
y=5*x*x*x*x-120*x*x*x+900*x*x-2400*x+1800;
return y;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CiBkb3VibGUgZnVuYyAoZG91YmxlIHgpOwogZG91YmxlIGRmIChkb3VibGUgeCk7CiBpbnQgbWFpbigpCnsKIGRvdWJsZSB4MCx4MTsKIGRvdWJsZSBkZWx0YT0xLjBlLTU7CiAgeDA9MC41OwoKIApmb3IoOzspewoKIHgxPXgwLWZ1bmMoeDApL2RmKHgwKTsKCiAgaWYoZmFicyhmdW5jKHgxKSk8ZGVsdGEpewogICAgcHJpbnRmKCLnrZTjgYjjga8lbGbjgafjgZnjgIJcbiIseDEpOwogICAgYnJlYWs7Cn0KICAgZWxzZXsKICAgICBwcmludGYoIiVsZuOBr+etlOOBiOOBp+OBr+OBguOCiuOBvuOBm+OCk1xuIix4MSk7CgogICAgIHgwPXgxOwogfQp9CiAgcmV0dXJuIDA7Cn0KZG91YmxlIGZ1bmMoZG91YmxlIHgpewpkb3VibGUgeTsKIHk9eCp4KngqeCp4LTMwKngqeCp4KngrMzAwKngqeCp4LTEyMDAqeCp4KzE4MDAqeC03MjA7CiByZXR1cm4geTsKfQogZG91YmxlIGRmKGRvdWJsZSB4KXsKICBkb3VibGUgeTsKICB5PTUqeCp4KngqeC0xMjAqeCp4KngrOTAwKngqeC0yNDAwKngrMTgwMDsKcmV0dXJuIHk7Cn0K