Răspuns :
1.
#include <iostream>
using namespace std;
int main()
{
int x, x1, x2, x3;
cin >> x;
x1=x%10;
x2=x/10%10;
x3=x/100%10;
if (x1>x2)
{
if (x3>x1)
{
cout << x2 << x3 << x1;
}
else cout << x3 << x2 << x1;
}
else
{
if (x3>x2) cout << x1 << x2 << x3;
else if ((x3<x2)&&(x3>x1)) cout << x1 << x3 << x2;
else cout << x3 << x1 << x2;
}
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int x, x1, sx=0, y, y1, sy=0;
cin >> x >> y;
x1=x;
y1=y;
while (x1!=0)
{
sx=sx+x1%10;
x1=x1/10;
}
while (y1!=0)
{
sy=sy+y1%10;
y1=y1/10;
}
if (sx>sy) cout << x;
else cout << y;
return 0;
}
3.
#include <iostream>
using namespace std;
int main()
{
int x, y, z, aux;
cin >> x >> y >> z;
if (x>y)
{
aux=x;
x=y;
y=aux;
}
if (x>z)
{
aux=x;
x=z;
z=aux;
}
if (y>z)
{
aux=y;
y=z;
z=aux;
}
cout << x << " " << y << " " << z;
return 0;
}