求助,30分python3,不知道为什么计算存的钱有问题
查看原帖
求助,30分python3,不知道为什么计算存的钱有问题
1070818
NAH0514楼主2023/9/25 13:55
give = 0
have = 300
stop = 0

for i in range(1,13):
    use = int(input())
    if (have-use) // 100 >0:
        give += ((have-use) // 100)*100
        have = ((have-use) % 100)
        have +=300

        
    elif have-use <0:
        stop = i
        break
if stop != 0:
    print("-",end = "")
    print(stop)
else:
    have = int(give *1.2 +have)
    print(have)

感谢大佬

2023/9/25 13:55
加载中...