Quiero encontrar el número más bajo de los cuatro, pero esto se ve un poco extraño, ¿no hay una manera más inteligente y más corta de hacerlo?Compara 4 variables para encontrar la más baja C++
Eso es lo que tengo:
int findlowest(int one, int two, int three, int four) {
int output = one //as of now , we will be outputting one , except if we find a lower score.
if(output > two) { out = two;} // if output is proven to be bigger than two, two is our new output.
if(output > three){ output = three;} //same operation with three
if(output > four){ output = four;} // same operation with four
return output;
}
¡Mierda que me ganaste por 7 segundos, y el mío tuvo un error! – Marlon
es el árbol equilibrado mejor 'std :: min (std :: min (a, b), std :: min (c, d));'? – osgx
@osgx: Sin diferencia funcional. –