by CodeChum Admin
A descending order means values arranged from largest to smallest. But in your case, you're going to have to sort these integers in ascending order, which means from smallest to largest.
Instructions:
Instructions
Input
A line containing three integers separated by a space.
6·1·3
Output
A line containing three integers separated by a space.
1·3·6
f = map(int, input().split())
if len(f) == 3:
if f[0] < f[1] and f[0] < f[2]:
if f[1] < f[2]:
print(f[0], f[1], f[2])
else:
print(f[0], f[2], f[1])
elif f[1] < f[0] and f[1] < f[2]:
if f[0] < f[2]:
print(f[1], f[0], f[2])
else:
print(f[1], f[2]. f[0])
else:
if f[0] < f[1]:
print(f[2], f[0], f[1])
else:
print(f[2], f[1], f[0])
Comments
Leave a comment