解题思路:
注意事项:
参考代码:
n=int(input())
list1=[]
for i in range(0,n):
s=str(input())
list1.append(list(s))
list2=[]
for i in range(0,n):
list1[i].append(' ')
list2.append([])
t=' '
for i in range(0,n):
k=1
for p in range(0,len(list1[i])-1):
if list1[i][p]==list1[i][p+1]:
k+=1
else:
if k!=1:
list2[i].append(k)
list2[i].append(list1[i][p])
k=1
for i in range(0,n):
for p in range(0,len(list2[i])):
print(list2[i][p],end='')
print('')
0.0分
2 人评分