for x in range(1,4): for y in range(1,4): for z in range(1,4): if x!=y and y!=z and x!=z: print(x*100+y*10+z) 运行结果: