文件名称:huangjin
介绍说明--下载内容均来自于网络,请自行研究使用
#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*(b-a)
x2=a+0.618*(b-a)
F1=Function(x1)
F2=Function(x2)
do
{
if(F1>F2)
{
a=x1
x1=x2
x2=a+0.618*(b-a)
F2=Function(x2)
}
else
{
b=x2
x2=x1
F2=F1
x1=b-0.618*(b-a)
F1=Function(x1)
}
}
while((b-a)>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
}-# 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 }
#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*(b-a)
x2=a+0.618*(b-a)
F1=Function(x1)
F2=Function(x2)
do
{
if(F1>F2)
{
a=x1
x1=x2
x2=a+0.618*(b-a)
F2=Function(x2)
}
else
{
b=x2
x2=x1
F2=F1
x1=b-0.618*(b-a)
F1=Function(x1)
}
}
while((b-a)>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
}-# 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 }
(系统自动生成,下载前可以参看下载内容)
下载文件列表
huangjin.txt