BC64 牛牛的快递

思路:

step1:输入两个字符;并将a转化为浮点型;
step2:计算金额;
step3:判断是否需要加急;
step4:计算总金额;

代码如下:

a,b = input().split()
a = float(a)
if a <= 1:
    money = 20
elif a > 1:
    m,n = divmod(a,1)
    money = 20 + (m - 1)*1
    if n > 0:
        money = money + 1
    else:
        money = money
if b == 'y':
    print(int(money + 5))
elif b == 'n':
    print(int(money))