Uhm, there are just
cases:
x > y > z
x > z > y
y > x > z
y > z > x
z > x > y
z > y > x
Code:
#include<iostream>
using namespace std;
main ()
{
int x, y, z, m;
cout<<"Please input the weight of all three bowls: \n";
cin>>x>>y>>z;
if (x>y && y>z)
m=y;
if (x>z && z>y)
m=z;
if (y>x && x>z)
m=x;
if (y>z && z>x)
m=z;
if (z>x && x>y)
m=x;
if (z>y && y>x)
m=y;
cout<<m;
} For your code and x = 9, y = 6, z = 7:
Code:
if(x>y&&y>z)
m=y;
if(x>y&&y<z)
m=z; //m=7
if(x>z&&y>z)
m=y;
if(x>z&&y<z)
m=z;
if(y>x&&x<z)
m=z;
if(y>x&&x>z)
m=x;
if(y>z&&z>x)
m=z;
if(y>z&&z<x)
m=x;
if(z>y&&y>x)
m=y;
if(z>y&&y<x)
m=x; //m=9
if(z>x&&y>x)
m=y;
if(z>x&&y<x)
m=x;