uble x2)
{x21 = rand (); double x22 = rand (); x21 = rand; double
// cout В«" f1 = "В« f1 В«" f2 = "В« f2 В«" f2 = "В« f2 В«endl; (f1> f2)
{(f1> f2)
{= f1; x1max = x11; x2max = x12;
if (f2> f2)
{= f2; y1min = x21; y2min = x22;
srf = f2; z1sr = x21; z2sr = x22;
}
{= f2; y1min = x21; y2min = x22;
srf = f2; z1sr = x21; z2sr = x22;
}
}
{= f2; x1max = x21; x2max = x22;
minf = f2; y1min = x21; y2min = x22;
srf = f1; z1sr = x11; z2sr = x12;
}
} (f1> f2)
{(f1> f2)
{= f1; x1max = x11; x2max = x12;
if (f2> f2)
{= f2; y1min = x21; y2min = x22;
srf = f2; z1sr = x21; z2sr = x22;
}
{= f2; y1min = x21; y2min = x22;
srf = f2; z1sr = x21; z2sr = x22;
}
}
{= f2; x1max = x21; x2max = x22;
minf = f2; y1min = x21; y2min = x22;
srf = f1; z1sr = x11; z2sr = x12;
}
}
{(f2> f2)
{= f2; x1max = x21; x2max = x22;
if (f1> f2)
{= f2; y1min = x21; y2min = x22;
srf = f1; z1sr = x11; z2sr = x12;
}
}
{= f2; x1max = x21; x2max = x22;
minf = f1; y1min = x11; y2min = x12;
srf = f2; z1sr = x21; z2sr = x22;
}
}
/* cout В«" maxf = "В« maxf В«" x1 = "В« x1max В«" x2 = "В« x2max В«endl
В«" minf = "В« minf В«" x1 = "В« y1min В«" x2 = "В« y2min В«endlВ« "srf ="
В«srfВ« "x1 =" В«z1srВ« "x2 =" В«z2srВ« endl; */
cout В«" minf = "В« minf В«" x1 = "В« y1min В«" x2 = "В« y2min В«endl; (in," minf =% f tx1 =% f tx2 =% f n ", minf, y1min, y2min);
// Центр ваги [4] = (y1min + z1sr)/n; [4] = (y2min + z2sr)/n; = 2 * (x1 [4] -2) * (x1 [4] -2) + (x2 [4] -2) * (x2 [4] -2);
// cout В«" x1 (n +2) = "В« x1 [4] В«" x2 (n +2) = "В« x2 [4] В«endl; p>
// Точка відображення [5] = x1 [4] + alfa * (x1 [4]-x1max);
x2 [5] = x2 [4] + alfa * (x2 [4]-x2max);
f5 = 2 * (x1 [5] -2) * (x1 [5] -2) + (x2 [5] -2) * (x2 [5] -2); p>