题解 | #Mileage Bank#

Mileage Bank

https://www.nowcoder.com/practice/8ec03ec1fa7544cf84244a441ff9405c

def Mileage(a, b):
    if b == 'F':
        return 2*a
    elif b == 'B':
        return int(a + 0.5*a + 0.5)
    elif b == 'Y' and a >= 500:
        return a
    else:
        return 500
s1 = 0
while True:

    
    s = list(input().split())
    if s[0] == '0' or s[0] == '#':
        break
    s1+=Mileage(int(s[2]), s[-1])
print(s1) 


全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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