m0_60492570 2021-09-27 10:44 采纳率: 71.4%
浏览 157
已结题

这个题有人会做吗?用python实现。

这个题有人会做吗?用python实现。感谢
这个题有人会做吗?用python实现。感谢
这个题有人会做吗?用python实现。感谢

img

a = int(input('国别(0--国内;1--外籍):'))

b = int(input('健康情况(0--健康;1--残疾):'))

c = int(input('舱别(0--头等舱;1--其他舱):'))

d = int(input('行李重量公斤数:'))

  • 写回答

1条回答 默认 最新

  • 偷窃月亮的贼 2021-09-27 10:59
    关注
    # coding=UTF-8
    country=int(input('国别(0--国内;1--外籍):'))
    health=int(input('健康情况(0--健康;1--残疾):'))
    level=int(input('舱别(0--头等舱;1--其他舱):'))
    weight=int(input('行李重量公斤数:'))
    money=0
    if weight>30:
        weight=weight-30
    else:
        weight=0
    if level==0:
        money=weight*6
    elif level==1:
        money=weight*4
    if health==1:
        money=0.5*money
    if country==1:
        money=2*money
    print("收费"+str(money)+"元")
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 10月5日
  • 已采纳回答 9月27日
  • 修改了问题 9月27日
  • 创建了问题 9月27日