'''
输入'abc',输出['abc', 'acb', 'bac', 'bca', 'cab', 'cba']。
写法太拙劣,勿怪
'''
def H(a):
d = [x for x in a] # 把A中的字符串放到一个列表存放单独的
b = []
for j in range(0,len(a)):
for i in range(0, len(a)-1):
d[i],d[i+1] = d[i+1],d[i]
b.append(d[i-1]+d[i]+d[i+1])
return b
print(H('abc'))