Description: # Include <stdio.h># Include <math.h> float Function (float x) void main () {float a, b, e float x0, x1, x2, F0, F1, F2 printf (" input a, b, e \ n" ) scanf (" f f f " , & a, & b, & e) x1 = b-0.618* (ba) x2 = a+0.618* (ba) F1 = Function (x1) F2 = Function (x2) do { if (F1> F2) {a = x1 x1 = x2 x2 = a+0.618* (ba) F2 = Function (x2) } else {b = x2 x2 = x1 F2 = F1 x1 = b-0.618* (ba) F1 = Function (x1) }} while ((ba)> e) x0 = (a+ b)/2 F0 = Function (x0) printf (" x0 = f, F0 = f \ n " , x0, F0) } float Function (float x) {float f f = x* x-7* x+10 return f }
To Search:
File list (Check if you may need any files):
huangjin.txt