题解 | #求解立方根#

求解立方根

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

# -*-coding:utf-8-*-
import math , string

while True:
    try:
        input_float = float(input())
        flag=1
        if input_float <0:
            input_float = 0-input_float
            flag=-1
        x = input_float**(1/3)*flag
        print("%.1f" %x)


    except:
        break

全部评论

相关推荐

点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
3
1
分享

创作者周榜

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