diff --git a/main.py b/main.py index 4c0c135f61696bcf42c375ca5ab62aa5b105afc8..5297b44a245bfb603b0d0ca81c0ee35b9f9e1e59 100644 --- a/main.py +++ b/main.py @@ -1 +1,59 @@ -print('欢迎来到 InsCode') \ No newline at end of file +num_list = {} + +n_list = {} + + + +index = 0 + +n = 0 + + + +for i in range(4, 10): + + for j in range(4, 10): + + for k in range(4, 10): + + for a in range(4, 10): + + if i != j and i != k and i != a and j != k and j != a and k != a: + + num_list[index] = i * 1000 + j * 100 + k * 10 + a + + index = index + 1 + + + +for m in num_list: + + x = num_list[m] + + for z in range(2, x): + + if x % z == 0: + + break + + else: + + n_list[n] = x + + n = n + 1 + + + +print("所有组合的数是 %s" % num_list) + + + +print("共有 %d 个" % len(num_list)) + + + +print("所有质数是 %s" % n_list) + + + +print("共有 %d 个" % len(n_list)) \ No newline at end of file