全错,求助!

P1320 压缩技术(续集版)

13730649604Q @ 2023-10-19 21:53:29

x=input() n=len(x) i=0 m=0 a=[] m1=[] a.append(x) z=x[0] while i<(n-1): s=input() a.append(s) i=i+1 for i in a: for j in i: if j==z: m+=1 else: m1.append(m) m=0 z=j m1.append(m) print(n,end=" ") for i in range(1,len(m1)+1): if i==1: print(m1[0],end=" ") else: print(int(m1[i-1])+1,end=" ")


by SF_bee @ 2023-10-19 21:56:00

建议使用代码块提问,不然看你代码的人很难受


by Lyrith_with_xQ @ 2023-10-19 22:00:56

希丰展?使MD!


|