题解 | 牛牛的绩点

牛牛的绩点

https://www.nowcoder.com/practice/de8bc3e736164786b07a4dd64ed172f7

cores = {'A':4.0,'B':3.0,'C':2.0,'D':1.0,'F':0}
score = 0
avg = 0
while 1:
    a = input() 
    
    if a in cores:
        b = int(input())
        score += cores[a] * b
        avg += b
       
    else:
        break
fin = score/avg
print('%.2f'%fin)   

哇好不容易哇🆒

全部评论

相关推荐

笑着秋招😊:我一直认为努力有回报是一件很幸福很幸福的事情,恭喜你
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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