L1-063 吃鱼还是吃肉 python

python 实现

num=int(input())
lst=[]
for i in range(num):
    s=input()
    gender=int(s.split(" ")[0]) # 1是男生 0是女生
    height=int(s.split(" ")[1])
    weight=int(s.split(" ")[2])

    lst.append([int(i) for i in s.split(" ")])

for item in lst:
    gender=item[0]
    height=item[1]
    weight=item[2]

    if gender==1:
        if height<130:
            print("duo chi yu!",end=" ")
        elif height==130:
            print("wan mei!",end=" ")
        else:
            print("ni li hai!",end=" ")

        if weight<27:
            print("duo chi rou!")
        elif weight==27:
            print("wan mei!")
        else:
            print("shao chi rou!")
    else:
        if height<129:
            print("duo chi yu!",end=" ")
        elif height==129:
            print("wan mei!",end=" ")
        else:
            print("ni li hai!",end=" ")

        if weight<25:
            print("duo chi rou!")
        elif weight==25:
            print("wan mei!")
        else:
            print("shao chi rou!")

 

posted @ 2024-06-28 17:23  豆豆是只乖狗狗  阅读(5)  评论(0编辑  收藏  举报