题解
2024-10-07 11:29:07
发布于:浙江
1阅读
0回复
0点赞
a = input()
n = int(input())
m = []
dict ={}
p = ''
c = 0
for i in range(n):
b = input()
if a in b:
b = b.replace(a,'')
m.append(b)
c =1
if c == 1:
for i in m:
i = i.split()
dict[i[0]] = i[1]
for i in dict:
for l in dict[i]:
for j in l:
if j>='a' and j<='z':
j = j.upper()
p = p+j
elif j>='A' and j<='Z':
j = j.lower()
p = p+j
else:
p = p+j
dict[i] = p
p = ''
for i in dict:
print(i,dict[i])
else:
print('empty')
这里空空如也
有帮助,赞一个