用Python写出代码 题目:有四个数字:1、2、3、4能组成多少个互不相同且无重复数字的三位数?各是多少?
num = [1, 2, 3, 4] count = 0 for i in num: for j in num: for k in num: if i != j and j != k and k != i: count += 1 print(i * 100 + j * 10 + k) print("共有{}个互不相同且无重复数字的三位数".format(count))
原文地址: https://cveoy.top/t/topic/EA9 著作权归作者所有。请勿转载和采集!