2013年10月9日

摘要: Problem 11In the 2020 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 0849 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 0081 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 6552 70 95 23 04 60 11 42 69 24 阅读全文
posted @ 2013-10-09 21:41 Monster_Ch 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Problem 9A Pythagorean triplet is a set of three natural numbers,abc, for which,a2+b2=c2For example, 32+ 42= 9 + 16 = 25 = 52.There exists exactly one Pythagorean triplet for whicha+b+c= 1000.Find the productabc.JAVA:public class P009 { public static void main(String[] args){ int a=0,b=0,c=0; int .. 阅读全文
posted @ 2013-10-09 21:39 Monster_Ch 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Problem 10The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.JAVA:public class P010 { public static void main(String[] args){ long sum = 0; for(int i=2;i<2000000;i++){ if(isprime(i)){ sum+=i; } } System.out.print(sum); } public static boo... 阅读全文
posted @ 2013-10-09 21:38 Monster_Ch 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Problem 8Find the greatest product of five consecutive digits in the 1000-digit number.731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331952853208805511125406987471585238630507156932909632952274430435576689664895044 阅读全文
posted @ 2013-10-09 21:38 Monster_Ch 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Problem 7By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the 10 001st prime number?\JAVA:public class P007 { public static void main(String[] args){ int num = 1; for(int i =3 ;;i++){ if(isprime(i)) num++; if(num==10001){ System.... 阅读全文
posted @ 2013-10-09 21:37 Monster_Ch 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Problem 6Published on Friday, 14th December 2001, 06:00 pm; Solved by 196379The sum of the squares of the first ten natural numbers is,12+ 22+ ... + 102= 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2= 552= 3025Hence the difference between the sum of the squares of 阅读全文
posted @ 2013-10-09 21:34 Monster_Ch 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Smallest multipleProblem 52520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that isevenly divisibleby all of the numbers from 1 to 20?JAVA:public class P005 { public static void main(String[] args){ int sum. 阅读全文
posted @ 2013-10-09 21:33 Monster_Ch 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Problem 4A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 9199.Find the largest palindrome made from the product of two 3-digit numbers.JAVA:public class P004 { public static void main(String[] args){ int a =0; int out=0; .. 阅读全文
posted @ 2013-10-09 21:32 Monster_Ch 阅读(125) 评论(0) 推荐(0) 编辑

导航