题解 | #字符逆序#

字符逆序

http://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b

#方法1
while True:
try:
    str1 = list(input())
    #等价 str1 = list(map(str,input()))
    print(''.join(reversed(str1)))
except:
    break

#方法2
while True:
try:
    s = list(input())
    print(''.join(s[::-1]))
except:
    break




全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
2
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务