Python求助
  • 板块P1953 易语言
  • 楼主MC_xjhjdA
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/10/6 08:46
  • 上次更新2024/10/6 10:30:25
查看原帖
Python求助
1227790
MC_xjhjdA楼主2024/10/6 08:46

为什么前者0分后者50分,在IDE里运行结果一样啊,样例2也过了,求调

s,o=input(),[]
if s.isdigit():
    s=int(s)
    try:
        time,w=0,0
        while 1:
            sl,sr=input().split()
            time+=1
            if time==1:
                sl=list(sl.strip())
                sr=list(sr.strip())
                for x in range(len(sl)):
                    if sl[x].isdigit():
                        del sl[x]
                        if w==0:
                            w=x
                for x in range(len(sr)):
                    if sr[x].isdigit():
                        del sr[x]
                slo,sro=sl,sr
            slotemp,srotemp=slo.copy(),sro.copy()
            slo.insert(w,str(s+time-1))
            sro.insert(w,str(s+time-1))
            print(''.join(slo),''.join(sro))
            slo,sro=slotemp,srotemp
    except:pass

......................................................................................

a,z,x=input().strip(),'1234567890','.'
if a.isdigit():
    b=int(a)
    try:
        while 1:
            c=input().split()
            if c[0][-1]in z:
                c[0]=c[0].strip(z)+str(b)
            else:
                c[0]=c[0].split(x)
                c[0][0]=c[0][0].strip(z)
                c[0]=c[0][0]+str(b)+x+c[0][1]
            if c[1][-1]in z:
                c[1]=c[1].strip(z)+str(b)
            else:
                c[1]=c[1].split(x)
                c[1][0]=c[1][0].strip(z)
                c[1]=c[1][0]+str(b)+x+c[1][1]
            print(c[0],c[1])
            b+=1
    except:
        pass
2024/10/6 08:46
加载中...