题解 | #牛牛的绩点#

牛牛的绩点

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

import sys


List = []
for i in sys.stdin:
    if "False" not in str(i):
        List.append(i)

junji = 0
score = 0
for i in range(len(List)):
    if "A" in List[i]:
        junji += int(List[i+1]) * 4
        score += int(List[i+1])
    elif "B" in List[i]:
        junji += int(List[i+1]) * 3
        score += int(List[i+1])
    elif "C" in List[i]:
        junji += int(List[i+1]) * 2
        score += int(List[i+1])
    elif "D" in List[i]:
        junji += int(List[i+1]) * 1
        score += int(List[i+1])
    elif "F" in List[i]:
        junji += 0
        score += int(List[i+1])
print("%.2f" % (junji / score))

全部评论

相关推荐

哞客37422655...:嫡系回归,buff叠满!好好干,等你们组明年把你当嫡长继承人的时候再请我们喝奶茶~
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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