1072. 开学寄语(20)——Python
2018-01-14 19:15
423 查看
def judge(string_2, list_things, count_things): #判断是否有违禁物品 my_list = [] for thing in list_things: if thing in string_2: count_things += 1 my_list.append(thing) #print(thing) return my_list, count_things if __name__ == '__main__': string_1 = input().split() string_2 = input().split() count_guys, count_things = 0, 0 for i in range(int(string_1[0])): list_things = [] string_3 = input().split() list_things = string_3[2:] list_things, count_things = judge(string_2, list_things, count_things) if list_things: count_guys += 1 print(string_3[0] + ': ', end = '') print(' '.join(list_things)) print("%d %d" %(count_guys,count_things))
相关文章推荐
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- pat 乙级 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- PAT (Basic Level) Practise (中文)1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 乙级 PAT 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- PAT乙级1072. 开学寄语(20)
- pat乙级1072. 开学寄语(20)
- PAT 1072. 开学寄语(20)
- PAT 乙级 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)
- 1072. 开学寄语(20)