摘要:
*Overall Goal*My current dreaming level of English Language is basically very moderate:able to read most best-selling books(in us not uk) without a di... 阅读全文
摘要:
找出200万以下的质数之和 def primeQ(n): for i in range(2, int (n**0.5) + 1): if n % i == 0: return False return Trueprint sum(filter(primeQ, range(2, 2000001)))>>>142913828922惨不忍睹!>< 阅读全文
摘要:
已知存在并且只存在一个毕达哥拉斯三元组满足条件a + b + c = 1000。 找出该三元组中abc的乘积。 for c in range(1, 500): for b in range(1, c): if (1000 - b - c)**2 + b**2 == c**2: print (1000 - b - c) * b * c ... 阅读全文
摘要:
第10001个质数是多少? def primeQ(n): for i in range(2, int (n**0.5) + 1): if n % i == 0: return False return Truex = 1n = 1while n < 10001: x = x + 2 if primeQ(x): n =... 阅读全文
摘要:
2520是最小的能被1-10中每个数字整除的正整数。 最小的能被1-20中每个数整除的正整数是多少? def gcd(a, b): product = a * b while b != 0: t = b b = a % b a = t return product / atemp = gcd(1, 2)for i in rang... 阅读全文
摘要:
13195的质数因子有5,7,13和29. 600851475143的最大质数因子是多少? #求num的最大质因数num = 600851475143sqrt = int (num**0.5)def primeQ(n): for i in range(2, int (n**0.5) + 1): if n % i == 0: return Fals... 阅读全文