PTA-Python-第2章-9 比较大小 (10分)

点击链接PTA-Python-AC全解汇总

题目:
本题要求将输入的任意3个整数从小到大输出。

输入格式:
输入在一行中给出3个整数,其间以空格分隔。

输出格式:
在一行中将3个整数从小到大输出,其间以“->”相连。

输入样例:

4 2 8

输出样例:

2->4->8

我的代码:

print(*sorted(map(int,input().split())),sep="->")

猜你喜欢

转载自blog.csdn.net/qq_34451909/article/details/107928389