题解 | 牛牛的考试

牛牛的考试

https://www.nowcoder.com/practice/1a7a7c8d721547a29107cf02330ffe72

import sys

for _ in range(int(sys.stdin.readline())):
    n1, op = [len(i) for i in [sys.stdin.readline() for _ in range(4)]], ["A", "B", "C", "D"]
    if n1.count(min(n1)) == 1 and n1.count(max(n1)) != 1:
        s = op[n1.index(min(n1))]
    elif n1.count(max(n1)) == 1 and n1.count(min(n1)) != 1:
        s = op[n1.index(max(n1))]
    else:
        s = op[2]
    print(s)

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

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