第3章-20 逆序的三位数 (10分)python

程序每次读入一个正3位数,然后输出按位逆序的数字。注意:当输入的数字含有结尾的0时,输出不应带有前导的0。比如输入700,输出应该是7。

输入格式:
每个测试是一个3位的正整数。

输出格式:
输出按位逆序的数。

输入样例:
123

输出样例:
321

s=list(input())
s.reverse()
a="".join(s)
print(int(a))
发布了59 篇原创文章 · 获赞 13 · 访问量 2575

猜你喜欢

转载自blog.csdn.net/weixin_45948920/article/details/104373303