python20分求调,感觉和人家代码区别不大啊
查看原帖
python20分求调,感觉和人家代码区别不大啊
1714510
wu55500楼主2025/7/1 16:37
#20分
def main():
    s=float(input())
    s=round(s,1)
    count,l=0,2
    if 0<=s<=100:
        while l<=s:
            l*=1.98
            count+=1
        print(count+1)
if __name__=="__main__":
    main()


#答案题解C++转换成python:100分
# ans = 0  
# x = float(input())  
# s = 2  # 小玉第一次的游泳距离
# d = 0  # 她游过的距离

# while d < x:  # 循环条件是游过的距离小于输入的距离
#     d += s  # 每次加上她游一次的距离
#     s = s * 0.98  
#     ans += 1  # 游泳次数每次增加一
# print(ans)  
2025/7/1 16:37
加载中...