{"id":952,"date":"2010-07-29T05:42:18","date_gmt":"2010-07-29T11:42:18","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=952"},"modified":"2010-08-11T19:47:30","modified_gmt":"2010-08-12T01:47:30","slug":"952","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/952","title":{"rendered":"\u540d\u6b21\u786e\u5b9a\u95ee\u9898\uff08Update\uff1a8\/10\uff09"},"content":{"rendered":"<p>\u4e94\u4f4d\u8fd0\u52a8\u5458\u53c2\u52a0\u6bd4\u8d5b\uff0c\u8fdb\u884c\u7ed3\u679c\u9884\u6d4b\uff1a<\/p>\n<p>A\u8bf4\uff1aB\u7b2c\u4e00\uff0c\u6211\u7b2c\u4e09<br \/>\nB\u8bf4\uff1a\u6211\u7b2c\u4e8c\uff0cE\u7b2c\u56db<br \/>\nC\u8bf4\uff1a\u6211\u7b2c\u4e00\uff0cD\u7b2c\u4e09<br \/>\nD\u8bf4\uff1aC\u6700\u540e\uff0c\u6211\u7b2c\u4e09<br \/>\nE\u8bf4\uff1a\u6211\u7b2c\u56db\uff0cA\u7b2c\u4e00<\/p>\n<p>\u6bd4\u8d5b\u7ed3\u675f\uff0c\u6bcf\u4f4d\u9009\u624b\u53ea\u8bf4\u5bf9\u4e86\u4e00\u534a\uff0c\u7f16\u7a0b\u786e\u5b9a\u6bd4\u8d5b\u540d\u6b21\u3002<\/p>\n<p>\u62ff\u5230\u8fd9\u9053\u9898\uff0c\u6211\u9996\u5148\u60f3\u5230\u7684\u662f\uff0cABCDE\u4e94\u4eba\u67095\uff01\u4e2a\u6392\u5217\u6b21\u5e8f\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u6b21\u5e8f\u90fd\u9a8c\u8bc1\u9898\u76ee\u8981\u6c42\uff0c\u6ee1\u8db3\u5373\u53efbreak\u5404\u4e2a\u5faa\u73af\u3002\u4e8e\u662f\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">#include \r\n\r\nint main()\r\n{\r\n\tint i,sum=0;\r\n\tint a,b,c,d,e;\r\n\tint flag=0;\r\n\r\n\tfor(a=1;a&lt;\\6;a++)\r\n\t{\r\n\t\tfor(b=1;b&lt;\\6;b++)\r\n\t\t{\r\n\t\t\tfor(c=1;c&lt;\\6;c++)\r\n\t\t\t{\r\n\t\t\t\tfor(d=1;d&lt;\\6;d++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfor(e=1;e&lt;\\6;e++)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\tsum=0;\r\n\t\t\t\t\t\tsum=(b==1||a==3)+(b==2||e==4)+(c==1||d==2)+(c==5||d==3)+(e==4||a==1);\r\n\t\t\t\t\t\tif(sum==5)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tflag=1;\r\n\t\t\t\t\t\t\tprintf(\"e=%d \",e);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(flag)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tprintf(\"d=%d \",d);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(flag)\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"c=%d \",c);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag)\r\n\t\t\t{\r\n\t\t\t\tprintf(\"b=%d \",b);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag)\r\n\t\t{\r\n\t\t\tprintf(\"a=%d \",a);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tprintf(\"\\n\");\r\n\treturn 0;\r\n}<\/pre>\n<p>\u7f16\u8bd1\u8fd0\u884c\u3002\u7ed3\u679c\u9519\u8bef\uff1a11134\u3002\u539f\u56e0\u662f\u8fd9\u6837\u7684\uff1a\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u7684\u5e8f\u5217\u5f88\u591a\uff0c\u4f46\u662f\u9047\u5230\u7b2c\u4e00\u4e2a\u6ee1\u8db3\u6761\u4ef6\u7684\u5e8f\u5217\uff08\u6b64\u65f6a\uff0cb\uff0cc\u90fd\u662f1\uff0c\u53ef\u89c1\u6ca1\u8dd1\u51e0\u4e0b\u5c31break\u4e86\uff09\u65f6\uff0c\u56e0\u4e3a\u591a\u4e2abreak\u7684\u539f\u56e0\u5c31\u8df3\u51fa\u4e86\u6240\u6709\u5faa\u73af\u3002\u770b\u6765\u8fd8\u5f97\u52a0\u4e00\u4e2a\u7b5b\u9009\u6761\u4ef6\u3002\u65e2\u7136\u540d\u5b57\u662f1\uff5e5\u7684\u4efb\u610f\u6392\u5e8f\uff0c\u90a3\u4e48\u4e94\u4f4d\u9009\u624b\u540d\u6b21\u4e4b\u548c\u80af\u5b9a\u662f\u56fa\u5b9a\u7684\uff0c\u56e0\u6b64\u52a0\u5165\u6b64\u6761\u4ef6\u5373\u53ef\u7b5b\u9009\u5904\u6700\u7ec8\u540d\u6b21\u3002\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush:c\">\t\t\t\t\t\tsum=0;\r\n\t\t\t\t\t\tsum=(b==1||a==3)+(b==2||e==4)+(c==1||d==2)+(c==5||d==3)+(e==4||a==1);\r\n\t\t\t\t\t\tif(sum==5)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif((a+b+c+d+e)==15)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tflag=1;\r\n\t\t\t\t\t\t\tprintf(\"e=%d \",e);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}<\/pre>\n<p>\u8fd9\u6837\u5c31OK\u4e86\u3002\u770b\u6765\u9664\u4e86\u5f97\u5230\u9898\u76ee\u8868\u9762\u7684\u4fe1\u606f\u540e\uff0c\u8fd8\u5f97\u5b66\u4f1a\u6293\u4f4f\u9690\u542b\u6761\u4ef6\u3002\u5176\u5b9e\u7b2c\u4e00\u4e2a\u6761\u4ef6\u4e5f\u53ef\u4ee5\u6709\u4e0b\u9762\u7684\u51e0\u79cd\u8868\u8fbe\u65b9\u5f0f\uff1a<\/p>\n<pre class=\"brush:c\">                                                \/\/\u65b9\u6cd51\r\n\t\t\t\t\t\tsum=0;\r\n\t\t\t\t\t\tsum+=(b==1&amp;&amp;a!=3)||(b!=1&amp;&amp;a==3);\r\n\t\t\t\t\t\tsum+=(b==2&amp;&amp;e!=4)||(b!=2&amp;&amp;e==4);\r\n\t\t\t\t\t\tsum+=(c==1&amp;&amp;d!=2)||(c!=1&amp;&amp;d==2);\r\n\t\t\t\t\t\tsum+=(c==5&amp;&amp;d!=3)||(c!=5&amp;&amp;d==3);\r\n\t\t\t\t\t\tsum+=(e==4&amp;&amp;a!=1)||(e!=4&amp;&amp;a==1);\r\n\t\t\t\t\t\t\/\/\u65b9\u6cd52\r\n\t\t\t\t\t\tsum=0;\r\n\t\t\t\t\t\tsum=(a==3||a==1)+(b==1||b==2)+(c==1||c==5)+(d==2||d==3)+(e==4);<\/pre>\n<p>\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e2a\u66f4\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u5728\u6211\u4f5c\u5b8c\u540e\uff0c\u6211\u89c9\u5f97\u8fd9\u4e2a\u9898\u76ee\u75285\u91cd\u5faa\u73af\u662f\u5426\u592a\u591a\u4f59\uff0c\u5c31\u60f3\u770b\u770b\u725b\u4eba\u662f\u5982\u4f55\u5b8c\u6210\u7684\uff0c\u6240\u4ee5\u5c31\u54a8\u8be2\u725b\u6d9b\uff0c\u5b83\u53d1\u8fc7\u6765\u4e00\u4e2a<a href=\"http:\/\/www.cnblogs.com\/276815076\/archive\/2010\/07\/29\/1787841.html\" target=\"_blank\">\u94fe\u63a5<\/a>\uff0c\u679c\u7136\u5f88\u7b80\u4fbf\u3002\u867d\u7136\u610f\u601d\u662f\u4e00\u6837\u7684\u4f46\u662f\u65f6\u95f4\u590d\u6742\u5ea6\u53ea\u6709N\u5e73\u65b9\u800c\u5df2\u3002\u6211\u8fd9\u4e2aN\u76845\u6b21\u65b9 <img src=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-includes\/images\/smilies\/5c5aa61ea0462b1940341709.gif\" alt=\"e42\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/>  \u3002<\/p>\n<p><strong><em><span style=\"color: #ff0000;\">Update\uff1a8\/10<\/span><\/em><\/strong><\/p>\n<p>\u4eca\u5929\u4e00\u4f4d\u540c\u5b66\u7559\u8a00\u8bf4\uff0c\u5224\u65ad\u6761\u4ef6\u5e94\u8be5\u518d\u52a0\u4e00\u6761\u5224\u65ada\uff0cb\uff0cc\uff0cd\uff0ce\u4e92\u4e0d\u76f8\u7b49\u3002\u8fd9\u4e2a\u6761\u4ef6\u5728\u6211\u505a\u8fd9\u4e2a\u9898\u7684\u65f6\u5019\u5c31\u60f3\u8fc7\uff0c\u53ef\u5f53\u65f6\u603b\u89c9\u7684\u4e24\u4e2a\u5224\u65ad\u6761\u4ef6\u5373\u53ef\u3002\u4f46\u662f\uff0c\u4e3a\u4ec0\u4e48\u4e0a\u9762\u7684\u4ee3\u7801\u4e5f\u53ef\u4ee5\u663e\u793a\u5904\u6b63\u786e\u7684\u7b54\u6848\uff1f\u90a3\u662f\u56e0\u4e3a\u6211\u52a0\u5165\u4e86break\u3002\u6070\u597d\u7b2c\u4e00\u7ec4\u540d\u8bcd\u5c31\u4e92\u4e0d\u76f8\u7b49\u3002\u5982\u679c\u628a\u6bcf\u4e2abreak\u90fd\u5220\u9664\u4e86\uff0c\u5c31\u4f1a\u53d1\u73b0\u6709\u4e24\u7ec4\u7ed3\u679c\uff0c\u5176\u4e2d\u4e00\u4e2a\u7ed3\u679c\u5c31\u6709\u91cd\u590d\u7684\u540d\u6b21\u3002<\/p>\n<p>\u5176\u5b9e\u8fd9\u4e2a\u9898\u76ee\u5c5e\u4e8e\u4e00\u4e2a\u7a77\u4e3e\u7c7b\u7684\u9898\u76ee\uff0c\u5e94\u8be5\u5728\u7a0b\u5e8f\u4e2d\u8ba9\u5b83\u5217\u51fa\u6240\u6709\u7684\u53ef\u80fd\uff08\u5c3d\u7ba1\u672c\u9898\u4e2d\u7684\u7b54\u6848\u53ea\u6709\u4e00\u4e2a\uff09\uff0c\u800c\u4e0d\u662f\u627e\u5230\u4e00\u4e2a\u5c31\u7acb\u523b\u505c\u6b62\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e94\u4f4d\u8fd0\u52a8\u5458\u53c2\u52a0\u6bd4\u8d5b\uff0c\u8fdb\u884c\u7ed3\u679c\u9884\u6d4b\uff1a A\u8bf4\uff1aB\u7b2c\u4e00\uff0c\u6211\u7b2c\u4e09 B\u8bf4\uff1a\u6211\u7b2c\u4e8c\uff0cE\u7b2c\u56db C\u8bf4\uff1a\u6211\u7b2c\u4e00\uff0cD\u7b2c\u4e09 D\u8bf4\uff1aC [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[109,130],"class_list":["post-952","post","type-post","status-publish","format-standard","hentry","category-c","tag-c","tag-130"],"views":8743,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/comments?post=952"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/952\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=952"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}