题解 | #圆周率的截取#

圆周率的截取

https://www.nowcoder.com/practice/cf8c7858d3ae48ccadb660b05d3cead5

import decimal
p = input()
n = int(input())

print(p[n])

decimal_point_index = p.find(".")
if decimal_point_index != -1:
    print(p[:decimal_point_index+n+1])
else:
    print(p)

全部评论

相关推荐

02-26 09:15
已编辑
蚌埠学院 golang
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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