{"id":933,"date":"2012-06-26T12:36:21","date_gmt":"2012-06-26T04:36:21","guid":{"rendered":"http:\/\/www.hsyyf.me\/?p=933"},"modified":"2012-06-26T12:39:11","modified_gmt":"2012-06-26T04:39:11","slug":"project-euler-4","status":"publish","type":"post","link":"https:\/\/www.hsyyf.me\/?p=933","title":{"rendered":"Project Euler 4"},"content":{"rendered":"<p>\u4eca\u5929\u662f\u7b2c\u56db\u9898\u3002<\/p>\n<p>A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 * 99.Find the largest palindrome made from the product of two 3-digit numbers.<\/p>\n<p>\u56de\u6587\u6570\uff0c\u662f\u6307\u4e00\u4e2a\u6574\u6570\u4ece\u5de6\u5230\u53f3\u548c\u4ece\u53f3\u5230\u5de6\u76f8\u7b49\u7684\u4e66\uff0c\u6bd4\u5982\u8bf411\uff0c121,112232211\u3002\u8fd9\u9053\u9898\u7684\u8981\u6c42\u662f\u627e\u51fa\u6700\u5927\u7684\u4e00\u4e2a\u56de\u6587\u6570\uff0c\u8981\u6c42\u8fd9\u4e2a\u6570\u662f\u7531\u4e24\u4e2a\u4e09\u4f4d\u6570\u76f8\u4e58\u800c\u5f97\u3002<\/p>\n<p>\u5224\u65ad\u56de\u6587\u6570\u7b80\u4ecb\u7684\u65b9\u5f0f\u662f\u5229\u7528python\u7684\u5b57\u7b26\u4e32\u53cd\u8f6c\u529f\u80fd\uff0c\u5373\u82e5s[::-1]==s\uff0c\u5219\u8be5\u5b57\u7b26\u4e32\u662f\u4e2a\u56de\u6587\u5b57\u7b26\u4e32\u3002\u601d\u8def\u662f\u5224\u65ad\u6240\u6709\u4e09\u4f4d\u6570\u4e24\u4e24\u4e58\u79ef\uff0c\u5224\u65ad\u662f\u5426\u662f\u56de\u6587\u6570\uff0c\u7136\u540e\u50a8\u5b58\u5728\u4e00\u4e2a\u6570\u7ec4\u4e2d\u3002\u5229\u7528max\u5bfb\u6c42\u6570\u7ec4\u4e2d\u7684\u6700\u5927\u503c\u3002\u8fd9\u79cd\u65b9\u5f0f\u7b80\u5355\u6613\u5b9e\u73b0\uff0c\u4f46\u662f\u4e0d\u5229\u4e8e\u5f97\u5230\u662f\u54ea\u4e24\u4e2a\u6570\u76f8\u4e58\u7684\u7ed3\u679c\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u8fd8\u662f\u6548\u7387\u95ee\u9898\uff0c\u76f4\u63a5\u5386\u904d\u6709\u6240\u53ef\u80fd\u6548\u7387\u592a\u4f4e\u3002<\/p>\n<p>Python\u5b9e\u73b0\uff1a<br \/>\n<code lang=\"Python\">#========================================================================<br \/>\n#   FileName: Palindromic.py<br \/>\n#     Author: hsyyf<br \/>\n#      Email: 931107419@qq.com<br \/>\n#   HomePage: http:\/\/www.hsyyf.me<br \/>\n# LastChange: 2012-06-26 12:14:52<br \/>\n#========================================================================<br \/>\nx=[]<br \/>\nfor i in range(999,100,-1):<br \/>\n    for j in range(999,100,-1):<br \/>\n        m=i*j<br \/>\n        s=str(m)<br \/>\n        if s==s[::-1]:<br \/>\n            x.append(m)<br \/>\n            break<br \/>\nprint(max(x))<\/p>\n<p>input(\"Input Enter to End\")<br \/>\n<\/code><\/p>\n<p>\u7ed3\u679c\u662f906609.<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u662f\u7b2c\u56db\u9898\u3002 A palindromic number reads the same both ways.  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[16],"tags":[127],"class_list":["post-933","post","type-post","status-publish","format-standard","hentry","category-16","tag-project-euler"],"_links":{"self":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts\/933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=933"}],"version-history":[{"count":0,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts\/933\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}