python;编译失败?
查看原帖
python;编译失败?
1393994
Lambency楼主2024/7/29 12:44

本地运行成功,样例全过;但经典提交编译失败!

下附代码,球球指教

h, l = map(str, input().strip().split())
op = ""
for i in h:
    if i in l:
        op = i
        break
hindex = h.index(op)
lindex = l.index(op)
o = []
for i in range(0, len(l)):
    if i == lindex:
        o.append(h)
        continue
    o.append(f'{'.'*hindex}{l[i]}{'.'*(len(h)-hindex-1)}')
for i in o:
    print(i)

2024/7/29 12:44
加载中...