URI Online Judge | 1042
Sort Simples
Adaptado por Neilor Tonin, URI
Brasil
Timelimit: 1
Brasil
Leia 3 valores inteiros e ordene-os em ordem crescente. No final, mostre os valores em ordem crescente, uma linha em branco e em seguida, os valores na sequência como foram lidos.
Entrada
A entrada contem três números inteiros.
Saída
Imprima a saída conforme foi especificado.
URI Online Judge | 1042
Simple Sort
Adapted by Neilor Tonin, URI
Brazil
Timelimit: 1
Brazil
Read three integers and sort them in ascending order. After, print these values in ascending order, a blank line and then the values in the sequence as they were readed.
Input
The input contains three integer numbers.
Output
Present the output as requested above.
x = input().split()
a, b, c = x
a = int(a)
b = int(b)
c = int(c)
if a > b and a > c:
d = a
if b > c:
e = b
f = c
else:
e = c
f = b
if b > a and b > c:
d = b
if a > c:
e = a
f = c
else:
e = c
f = a
if c > a and c > b:
d = c
if a > b:
e = a
f = b
else:
f = a
e = b
print(f)
print(e)
print(d)
print()
print(a)
print(b)
print(c)
Nenhum comentário:
Postar um comentário