{"id":7531,"date":"2015-08-23T17:05:01","date_gmt":"2015-08-23T09:05:01","guid":{"rendered":"http:\/\/jpuyy.com\/?p=7531"},"modified":"2015-08-23T17:05:01","modified_gmt":"2015-08-23T09:05:01","slug":"%e6%89%be%e5%87%ba%e7%89%b9%e6%ae%8a%e7%9a%84%e4%b9%9d%e4%bd%8d%e6%95%b0-python","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=7531","title":{"rendered":"\u627e\u51fa\u7279\u6b8a\u7684\u4e5d\u4f4d\u6570-python"},"content":{"rendered":"<p>1~9\u76849\u4e2a\u6570\u5b57\uff0c \u6bcf\u4e2a\u6570\u5b57\u53ea\u80fd\u51fa\u73b0\u4e00\u6b21\uff0c \u8981\u6c42\u8fd9\u6837\u76849\u4f4d\u6570\uff1a\u5176\u7b2c\u4e00\u4f4d\u80fd\u88ab1\u6574\u9664\uff0c \u524d\u4e24\u4f4d\u80fd\u88ab2\u6574\u9664\uff0c \u524d\u4e09\u4f4d\u80fd\u88ab3\u6574\u9664&#8230;\u4f9d\u6b21\u7c7b\u63a8\uff0c\u524d9\u4f4d\u80fd\u88ab9\u6574\u9664\u3002\u6240\u6709\u76849\u4f4d\u6570\u4e2d\uff0c\u53ea\u6709\u4e00\u4e2a\u6570\u5b57\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u8bf7\u4f60\u8f93\u51fa\u8fd9\u4e2a9\u4f4d\u6570\u3002<\/p>\n<p>\u601d\u8def\uff1a<br \/>\n\u6839\u636e\u63cf\u8ff0\u5199\u51fa\u51fd\u6570\uff0c\u5224\u65ad\u91cd\u590d\uff0c\u7f29\u5c0f\u8303\u56f4<\/p>\n<pre>\r\n#!\/usr\/bin\/env python\r\n#-*- coding:utf-8 -*-\r\n\r\n\r\ndef no_repeat(my_num):\r\n    uniq_str=''.join(set(str(my_num)))\r\n    if len(str(my_num)) == len(uniq_str):\r\n        return True\r\n\r\ndef possible(prefix):\r\n    possible_list = []\r\n    number_len = len(str(prefix)) + 1\r\n    for i in range(10*prefix + 1, 10*(prefix+1)):\r\n        if (i % number_len == 0) and no_repeat(i) and (number_len<9):\r\n            possible(i)\r\n        elif (i % number_len == 0) and no_repeat(i) and number_len == 9:\r\n            print i\r\n\r\ndef main():\r\n    for i in range(1,10):\r\n        possible(i)\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1~9\u76849\u4e2a\u6570\u5b57\uff0c \u6bcf\u4e2a\u6570\u5b57\u53ea\u80fd\u51fa\u73b0\u4e00\u6b21\uff0c \u8981\u6c42\u8fd9\u6837\u76849\u4f4d\u6570\uff1a\u5176\u7b2c\u4e00\u4f4d\u80fd\u88ab1\u6574\u9664\uff0c \u524d\u4e24\u4f4d\u80fd\u88ab2\u6574\u9664\uff0c \u524d\u4e09\u4f4d\u80fd\u88ab3\u6574\u9664&#8230;\u4f9d\u6b21\u7c7b\u63a8\uff0c\u524d9\u4f4d\u80fd\u88ab9\u6574\u9664\u3002\u6240\u6709\u76849\u4f4d\u6570\u4e2d\uff0c\u53ea\u6709\u4e00\u4e2a\u6570\u5b57\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u8bf7\u4f60\u8f93\u51fa\u8fd9\u4e2a9\u4f4d\u6570\u3002 \u601d\u8def\uff1a \u6839\u636e\u63cf\u8ff0\u5199\u51fa\u51fd\u6570\uff0c\u5224\u65ad\u91cd\u590d\uff0c\u7f29\u5c0f\u8303\u56f4 #!\/usr\/bin\/env python #-*- coding:utf-8 -*- def no_repeat(my_num): uniq_str=&#8221;.join(set(str(my_num))) if len(str(my_num)) == len(uniq_str): return True def possible(prefix): possible_list = [] number_len = len(str(prefix)) + 1 for i in range(10*prefix + 1, 10*(prefix+1)): if (i % number_len == 0) and no_repeat(i) and (number_len<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76],"tags":[],"class_list":["post-7531","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7531"}],"version-history":[{"count":1,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7531\/revisions"}],"predecessor-version":[{"id":7532,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7531\/revisions\/7532"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}