1,2,3,4の4つの数、3つの数の組み合わせを選択して、3つの数の要求は互いに異なっています

372 ワード

#coding:utf-8

#1,2,3,4   ,       ,         
import copy

def Remove(List,i):
    a=copy.deepcopy(List)
    a.remove(i)
    return a

numlist=[1,2,3,4]
num=0
for i in numlist:
    a=Remove(numlist,i)
    for j in a:
        b=Remove(a,j)
        for k in b :
            print (i*100+j*10+k)
            num=num+1
print ('        %d' %num)