#17.有四个数字:1 2 3 4 ,能组成多少个各不相同且数字不重复的三位数?各是多少? count = 0 for i in range(1,5): for j in range(1,5): for k in range(1,5): if i == j or j == k or i == k: continue #来到循环开始的地方:for i in range(1,5) count += 1 print(str(i)+str(j)+str(k)) print(count)
2024-02-19 15:53:34
#17.有四个数字:1 2 3 4 ,能组成多少个各不相同且数字不重复的三位数?各是多少? count = 0 for i in range(1,5): for j in range(1,5): for k in range(1,5): if i == j or j == k or i == k: continue #来到循环开始的地方:for i in range(1,5) count += 1 print(str(i)+str(j)+str(k)) print(count)