Un Joyero fabrica dos tipos de joyas. La unidad de tipo A se hace con 1g de oro y 1,5 g de plata y se vende a $25. La de tipo B se vende a $30 y lleva 1,5 g de oro y 1 g de plata. Si solo se dispone de 750 g de cada metal, ¿Cuantas joyas ha de fabricar de cada tipo para obtener el maximo beneficio?
++ #include <iostream> #include <cmath> #include <fstream> #include <string> using namespace std; float f1(float x, float y) { return 25*x + 30*y; } float f2(float x, float y) { if (x == 0) return 0; else if(y == 0) return 0; else { return (1*x + 1.5*y)/(1*x + 1.5*y + 1.5*x + 1*y)*f1(x,y); } } int main() { ofstream outfile; outfile.open("ejemplo.txt"); float x = 0; float y = 0; float z = 0; float z_max = 0; float x_max = 0; float y_max = 0; while (f2(x, y) <= 1) { while (f2