作业二:有1,2,3,4个数字,能组成多少个互不相同且无重复数字得三位数

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tingloveyou/article/details/83058582
count = 0
for x  in range (1,5):
    for y  in range(1,5):
        for z in range(1,5):
            if (x != y) and (y != z ) and (z != x  ):
                count = count +1
                print('%d:''%d%d%d'%(count,x,y,z,))

print('总共有%d个互不相同且无重复数字的三位数'%count)

猜你喜欢

转载自blog.csdn.net/tingloveyou/article/details/83058582