题解 | #查找组成一个偶数最接近的两个素数#
查找组成一个偶数最接近的两个素数
http://www.nowcoder.com/practice/f8538f9ae3f1484fb137789dec6eedb9
while True: try: def isPrime(num): for i in range(2, num): if num % i == 0: return False return True num = int(input()) mid = num//2 end = mid + 1 for i in range(0, end): left, right = mid-i,mid+i if isPrime(left) and isPrime(right): print(left) print(right) break except: break