【问题描述】从键盘输入五个[0,9]之间的整数数字,能组成多少个互不相同且无重复数字的三位数,并输出这些数。
【样例输入】1
2
3
4
0
【样例输出】
321,421,231,431,201,301,401,241,341,312,412,132,432,102,302,402,142,342,213,413,123,423,103,203,403,143,243,210,310,410,120,320,420,130,230,430,140,240,340,214,314,124,324,134,234,104,204,304,
共有48个
a=[]
for i in range (0,5):
b=eval(input())
a.append(b)
q=0
for j in a:
for k in a:
for l in a:
if j!=k and k!=l and j!=l and l!=0:
print(j+10*k+100*l,end=",")
q+=1
print()
print("共有{}个".format(q))
2925

被折叠的 条评论
为什么被折叠?



