int x;
cin >> x;
int y;
cin >>y ;
int z;
cin >> z;
if (x <= y && x <= z && y <= z)
{
cout << "x," << "y," << "z" << endl;
}
else if (y <= x && y <= z && x<= z)
cout << "y," << "x," << "z" << endl;
else if (z <= x && z <= y && x <= y)
cout << "z," << "x," << "y" << endl;
else if (y <= x && x<= z && z <= x)
cout << "y," << "z," << "x" << endl;
else
cout << "z," << "y," << "x" << endl;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
int x;
cin >> x;
int y;
cin >>y ;
int z;
cin >> z;
if (x <= y && x <= z && y <= z)
{
cout << "x," << "y," << "z" << endl;
}
else if (y <= x && y <= z && x<= z)
{
cout << "y," << "x," << "z" << endl;
}
else if (z <= x && z <= y && x <= y)
{
cout << "z," << "x," << "y" << endl;
}
else if (y <= x && x<= z && z <= x)
{
cout << "y," << "z," << "x" << endl;
}
else
{
cout << "z," << "y," << "x" << endl;
}