题解 | #记票统计#

记票统计

https://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894

num=int(input())
candidate=list(input().split(' ')) 
people=int(input())
tickets=list(input().split(' '))
flag=0
for i in candidate:
    if i!='': #不能用字符串
        print(i+' : '+str(tickets.count(i)))
for j in tickets:
    if j not in candidate:
        flag=flag+1
print('Invalid : '+str(flag))

全部评论

相关推荐

陆续:不可思议 竟然没那就话 那就我来吧 :你是我在牛客见到的最美的女孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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