{"id":27622,"date":"2018-06-30T02:12:26","date_gmt":"2018-06-29T18:12:26","guid":{"rendered":"http:\/\/www.fagao.me\/?p=27622"},"modified":"2018-06-30T02:12:26","modified_gmt":"2018-06-29T18:12:26","slug":"%e7%ac%ac%e5%9b%9b%e7%ab%a0%e4%b8%89%e8%af%86c%e8%af%ad%e8%a8%80-%e7%a8%8b%e5%ba%8f%e7%9a%84%e7%81%b5%e9%ad%82%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.fagao.me\/p\/27622.htm","title":{"rendered":"\u7b2c\u56db\u7ae0\u4e09\u8bc6C\u8bed\u8a00 \u7a0b\u5e8f\u7684\u7075\u9b42\u7b97\u6cd5"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.fagao.me\/images\/uploads\/2019_009.jpg\" alt=\"\"><\/p>\n<p><span class=\"bjh-p\">\u7a0b\u5e8f\u7684\u7075\u9b42\u662f\u201c\u7b97\u6cd5\u201d\uff0c\u90a3\u4e48\u4ec0\u4e48\u662f\u7b97\u6cd5\uff1f\u6211\u4eec\u6240\u5199\u7684\u7a0b\u5e8f\u90fd\u662f\u6709\u5177\u4f53\u7684\u4efb\u52a1\u8981\u6267\u884c\u7684\uff0c\u4f46\u662f\u53ef\u4ee5\u6709\u591a\u79cd\u65b9\u6cd5\u6765\u8fbe\u5230\u540c\u4e00\u79cd\u76ee\u7684\uff0c\u800c\u6211\u4eec\u9700\u8981\u505a\u7684\u5c31\u662f\u9009\u62e9\u5176\u4e2d\u6700\u597d\u7684\u90a3\u4e00\u79cd\u65b9\u6cd5\uff0c\u5e76\u7528C\u8bed\u8a00\u5c06\u5b83\u8868\u8fbe\u51fa\u6765\u3002\u5176\u5b9e\u8fd9\u6bb5\u65f6\u95f4\u6211\u4e00\u76f4\u5728\u5f3a\u8c03\uff0c\u7f16\u7a0b\u96be\u7684\u4e0d\u662f\u5199\u7a0b\u5e8f\uff0c\u800c\u662f\u5982\u4f55\u8bbe\u8ba1\u597d\u5de5\u4f5c\u65b9\u6cd5\u4e5f\u5c31\u662f\u8fd9\u91cc\u7684\u7b97\u6cd5\u4e86\u3002<\/span><\/p>\n<div class=\"img-container\"><\/div>\n<p><span class=\"bjh-p\">\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">1\u7b97\u6cd5\u7684\u57fa\u672c\u6982\u5ff5<\/span><\/p>\n<p><span class=\"bjh-p\">1.1\u6982\u5ff5<\/span><\/p>\n<p><span class=\"bjh-p\">\u8ba1\u7b97\u673a\u7a0b\u5e8f = \u6570\u636e\u7ed3\u6784 + \u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">\u7b97\u6cd5\u5c31\u662f\u5bf9\u89e3\u51b3\u95ee\u9898\u7684\u65b9\u6848\u51c6\u786e\u800c\u5b8c\u6574\u7684\u63cf\u8ff0\uff0c\u4e5f\u5c31\u662f\u63cf\u8ff0\u5982\u4f55\u89e3\u51b3\u95ee\u9898\u7684<\/span><\/p>\n<p><span class=\"bjh-p\">1.2\u7b97\u6cd5\u7684\u8bc4\u5b9a\u6807\u51c6<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u7684\u65f6\u95f4\u6d88\u8017\uff08\u91cd\u70b9\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e3b\u8981\u63cf\u8ff0\u7b97\u6cd5\u7684\u65f6\u95f4\u6d88\u8017\u548c\u95ee\u9898\u89c4\u6a21\u4e4b\u95f4\u7684\u51fd\u6570\u5173\u7cfb<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7a7a\u95f4\u590d\u6742\u5ea6<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e3b\u8981\u63cf\u8ff0\u7b97\u6cd5\u7684\u7a7a\u95f4\u6d88\u8017\u548c\u95ee\u9898\u89c4\u6a21\u4e4b\u95f4\u7684\u51fd\u6570\u5173\u7cfb<\/span><\/p>\n<p><span class=\"bjh-p\">\uff083\uff09\u6b63\u786e\u6027<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e3b\u8981\u63cf\u8ff0\u7b97\u6cd5\u7684\u6267\u884c\u7ed3\u679c\u662f\u5426\u6b63\u786e\uff0c\u662f\u5426\u6ee1\u8db3\u8981\u6c42<\/span><\/p>\n<p><span class=\"bjh-p\">\uff084\uff09\u53ef\u8bfb\u6027<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e3b\u8981\u63cf\u8ff0\u7b97\u6cd5\u7684\u601d\u60f3\u548c\u6d41\u7a0b\u662f\u5426\u5bb9\u6613\u9605\u8bfb<\/span><\/p>\n<p><span class=\"bjh-p\">\uff085\uff09\u5065\u58ee\u6027<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e3b\u8981\u63cf\u8ff0\u7b97\u6cd5\u5bf9\u975e\u6b63\u5e38\u8f93\u5165\u7684\u53cd\u5e94\u548c\u5904\u7406\u80fd\u529b\uff08\u7528\u6237\u4f53\u9a8c\u5ea6\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">1.3\u7b97\u6cd5\u7684\u63cf\u8ff0\u5f62\u5f0f<\/span><\/p>\n<p><span class=\"bjh-p\">\u81ea\u7136\u8bed\u8a00\uff08\u6ce8\u91ca\uff09\u3001\u4f2a\u4ee3\u7801\uff08\u5982\uff1aif\uff08\u4e8c\u53c9\u6811\u4e3a\u7a7a\uff09{ }\uff09\u3001\u6d41\u7a0b\u56fe\u3001PAD\u56fe<\/span><\/p>\n<p><span class=\"bjh-p\">2\u67e5\u627e\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">2.1\u7ebf\u6027\u67e5\u627e\u7b97\u6cd5\uff08\u987a\u5e8f\u67e5\u627e\u7b97\u6cd5\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u6d41\u7a0b<\/span><\/p>\n<p><span class=\"bjh-p\">\u4f7f\u7528\u76ee\u6807\u5143\u7d20\u4e0e\u4e00\u7ec4\u6570\u5217\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4f9d\u6b21\u8fdb\u884c\u6bd4\u8f83\uff0c\u76f4\u5230\u67e5\u627e\u6210\u529f\uff0c\u6216\u8005\u4e0e\u6240\u6709\u7684\u5143\u7d20\u6bd4\u8f83\u5b8c\u6bd5\uff0c\u8868\u793a\u67e5\u627e\u5931\u8d25<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7b97\u6cd5\u8bc4\u4ef7<\/span><\/p>\n<p><span class=\"bjh-p\">\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6 O\uff08N\uff09&#8212;&#8212;&#8211;\u201cO\u201d\u8868\u793a\u65f6\u95f4\u590d\u6742\u5ea6&#8212;&#8212;&#8211;\u201cN\u201d\u8868\u793a\u6570\u636e\u7684\u4e2a\u6570<\/span><\/p>\n<p><span class=\"bjh-p\">\u5bf9\u6837\u672c\u7684\u6709\u5e8f\u6027\u4e0d\u654f\u611f<\/span><\/p>\n<p><span class=\"bjh-p\">2.2\u4e8c\u5206\u67e5\u627e\u7b97\u6cd5\uff08\u6298\u534a\u67e5\u627e\u7b97\u6cd5\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u6d41\u7a0b<\/span><\/p>\n<p><span class=\"bjh-p\">\u5047\u8bbe\u6837\u672c\u6570\u636e\u4ece\u5c0f\u5230\u5927\u4f9d\u6b21\u6392\u5217\uff0c\u9996\u5148\u9009\u62e9\u4e2d\u95f4\u5143\u7d20\u8fdb\u884c\u6bd4\u8f83\uff0c\u5982\u679c\u76f8\u7b49\u76f4\u63a5\u8fd4\u56de\uff0c\u8868\u793a\u67e5\u627e\u6210\u529f\uff1b\u5982\u679c\u76ee\u6807\u5143\u7d20\u5927\u4e8e\u4e2d\u95f4\u5143\u7d20\uff0c\u5219\u53bb\u4e2d\u95f4\u5143\u7d20\u7684\u53f3\u4fa7\u67e5\u627e\uff0c\u5982\u679c\u76ee\u6807\u5143\u7d20\u5c0f\u4e8e\u4e2d\u95f4\u5143\u7d20\uff0c\u5219\u53bb\u4e2d\u95f4\u5143\u7d20\u7684\u5de6\u4fa7\u67e5\u627e\uff0c\u91cd\u590d\u4ee5\u4e0a\u8fc7\u7a0b\uff0c\u76f4\u5230\u627e\u5230\u6ee1\u8db3\u6761\u4ef6\u7684\u5143\u7d20\u8868\u793a\u67e5\u627e\u6210\u529f\uff0c\u6216\u8005\u6ca1\u6709\u627e\u5230\uff0c\u8868\u793a\u67e5\u627e\u5931\u8d25<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7b97\u6cd5\u8bc4\u4ef7<\/span><\/p>\n<p><span class=\"bjh-p\">\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6 O\uff08logN\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">\u8981\u6c42\u6837\u672c\u5fc5\u987b\u6709\u5e8f<\/span><\/p>\n<p><span class=\"bjh-p\">3\u5e38\u89c1\u7684\u6392\u5e8f\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">3.1\u5192\u6ce1\u6392\u5e8f\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">\u6bd4\u8f83\u76f8\u90bb\u4f4d\u7f6e\u7684\u5143\u7d20<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u6d41\u7a0b<\/span><\/p>\n<p><span class=\"bjh-p\">a.\u6bd4\u8f83\u76f8\u90bb\u4f4d\u7f6e\u7684\u5143\u7d20\uff0c\u5982\u679c\u7b2c\u4e00\u4e2a\u6bd4\u7b2c\u4e8c\u4e2a\u5927\uff0c\u5219\u4ea4\u6362\u4e24\u4e2a\u5143\u7d20\u7684\u4f4d\u7f6e<\/span><\/p>\n<p><span class=\"bjh-p\">b.\u5bf9\u6bcf\u4e00\u5bf9\u76f8\u90bb\u4f4d\u7f6e\u7684\u5143\u7d20\u505a\u540c\u6837\u7684\u5de5\u4f5c\uff0c\u4ece\u5f00\u59cb\u7684\u7b2c\u4e00\u5bf9\u4e00\u76f4\u5230\u6700\u540e\u4e00\u5bf9\uff0c\u7ecf\u8fc7\u8fd9\u4e00\u6b65\uff0c\u6700\u540e\u7684\u5143\u7d20\u5c06\u662f\u8fd9\u7ec4\u5143\u7d20\u4e2d\u7684\u6700\u5927\u503c<\/span><\/p>\n<p><span class=\"bjh-p\">c.\u9488\u5bf9\u6240\u6709\u7684\u5143\u7d20\u91cd\u590d\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u9664\u4e86\u6700\u540e\u4e00\u4e2a\u5143\u7d20<\/span><\/p>\n<p><span class=\"bjh-p\">d.\u6301\u7eed\u5bf9\u8d8a\u6765\u8d8a\u5c11\u7684\u5143\u7d20\u91cd\u590d\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u76f4\u5230\u6ca1\u6709\u5143\u7d20\u9700\u8981\u4ea4\u6362\u4e3a\u6b62<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7b97\u6cd5\u8bc4\u4ef7<\/span><\/p>\n<p><span class=\"bjh-p\">\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6 O\uff08N^2\uff09,\u7a33\u5b9a\uff0c\u5bf9\u6837\u672c\u7684\u6709\u5e8f\u6027\u975e\u5e38\u654f\u611f<\/span><\/p>\n<p><span class=\"bjh-p\">3.2\u63d2\u5165\u6392\u5e8f\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u6d41\u7a0b<\/span><\/p>\n<p><span class=\"bjh-p\">\u6597\u5730\u4e3b \u6293\u6251\u514b\u724c<\/span><\/p>\n<p><span class=\"bjh-p\">a.\u5047\u5b9a\u7b2c\u4e00\u4e2a\u5143\u7d20\u5df2\u7ecf\u6709\u5e8f<\/span><\/p>\n<p><span class=\"bjh-p\">b.\u4ece\u7b2c\u4e8c\u4e2a\u5143\u7d20\u8d77\u4f9d\u6b21\u53d6\u51fa\uff0c\u4f7f\u7528\u53d6\u51fa\u7684\u5143\u7d20\u4f9d\u6b21\u548c\u5de6\u8fb9\u7684\u5143\u7d20\u8fdb\u884c\u6bd4\u8f83\uff0c\u5982\u679c\u5de6\u8fb9\u7684\u5143\u7d20\u5927\u4e8e\u53d6\u51fa\u7684\u5143\u7d20\uff0c\u5219\u5de6\u8fb9\u7684\u5143\u7d20\u53f3\u79fb<\/span><\/p>\n<p><span class=\"bjh-p\">d\u3002\u5982\u679c\u5de6\u8fb9\u7684\u5143\u7d20\u5c0f\u4e8e\u53d6\u51fa\u7684\u5143\u7d20\uff0c\u6216\u8005\u5de6\u8fb9\u5df2\u7ecf\u6ca1\u6709\u5143\u7d20\uff0c\u5219\u5c06\u53d6\u51fa\u7684\u5143\u7d20\u63d2\u5165\u5230\u5de6\u8fb9\u5143\u7d20\u7684\u53f3\u8fb9\uff0c\u6216\u8005\u63d2\u5165\u5230\u6700\u5de6\u8fb9<\/span><\/p>\n<p><span class=\"bjh-p\">e.\u91cd\u590d\u6b65\u9aa4\u4e8c\uff0c\u76f4\u5230\u5904\u7406\u5b8c\u6bd5\u6240\u6709\u7684\u5143\u7d20\u4e3a\u6b62<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7b97\u6cd5\u8bc4\u4ef7<\/span><\/p>\n<p><span class=\"bjh-p\">\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6O(N^2),\u7a33\u5b9a\uff0c\u5bf9\u6837\u672c\u7684\u6709\u5e8f\u6027\u975e\u5e38\u654f\u611f\uff0c\u4f46\u662f\u8d4b\u503c\u7684\u6b21\u6570\u6bd4\u5192\u6ce1\u6392\u5e8f\u5c11\uff0c\u56e0\u6b64\u7565\u4f18\u4e8e\u5192\u6ce1\u6392\u5e8f<\/span><\/p>\n<p><span class=\"bjh-p\">3.3\u9009\u62e9\u6392\u5e8f\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u6d41\u7a0b<\/span><\/p>\n<p><span class=\"bjh-p\">a.\u4ece\u7b2c\u4e00\u4e2a\u5143\u7d20\u8d77\u4f9d\u6b21\u53d6\u51fa\uff0c\u5e76\u5047\u5b9a\u8be5\u5143\u7d20\u662f\u6700\u5c0f\u503c\uff0c\u4f7f\u7528\u53d8\u91cfmin\u8bb0\u5f55\u8be5\u5143\u7d20\u7684\u4e0b\u6807<\/span><\/p>\n<p><span class=\"bjh-p\">b.\u4f7f\u7528min\u8bb0\u5f55\u7684\u5143\u7d20\u4e0e\u540e\u9762\u7684\u5143\u7d20\u4f9d\u6b21\u6bd4\u8f83\uff0c\u5982\u679c\u627e\u5230\u4e86\u6bd4min\u8bb0\u5f55\u7684\u5143\u7d20\u8fd8\u5c0f\u7684\u5143\u7d20\uff0c\u5219\u4f7f\u7528min\u8bb0\u5f55\u66f4\u5c0f\u7684\u5143\u7d20<\/span><\/p>\n<p><span class=\"bjh-p\">c.\u76f4\u5230\u4f7f\u7528min\u8bb0\u5f55\u7684\u5143\u7d20\u4e0e\u540e\u7eed\u6240\u6709\u5143\u7d20\u6bd4\u8f83\u5b8c\u6bd5\uff0c\u6b64\u65f6\u4f7f\u7528min\u8bb0\u5f55\u7684\u6700\u5c0f\u503c\u548c\u6700\u5f00\u59cb\u5047\u5b9a\u7684\u6700\u5c0f\u503c\u4ea4\u6362\u4f4d\u7f6e\uff0c\u7ecf\u8fc7\u8fd9\u4e00\u6b65\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u5df2\u7ecf\u662f\u6700\u5c0f\u7684<\/span><\/p>\n<p><span class=\"bjh-p\">d.\u91cd\u590d\u4ee5\u4e0a\u8fc7\u7a0b\uff0c\u76f4\u5230\u6240\u6709\u5143\u7d20\u6709\u5e8f\u4e3a\u6b62<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7b97\u6cd5\u8bc4\u4ef7<\/span><\/p>\n<p><span class=\"bjh-p\">\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6O(N^2),\u4e0d\u7a33\u5b9a\uff0c\u5bf9\u6837\u672c\u7684\u6709\u5e8f\u6027\u4e0d\u654f\u611f\uff0c\u867d\u7136\u6bd4\u8f83\u7684\u6b21\u6570\u591a\uff0c\u4f46\u662f\u4ea4\u6362\u7684\u6b21\u6570\u6bd4\u8f83\u5c11\uff0c\u56e0\u6b64\u4e00\u822c\u60c5\u51b5\u4e0b\u7565\u4f18\u4e8e\u5192\u6ce1\u6392\u5e8f<\/span><\/p>\n<p><span class=\"bjh-p\">4.\u5feb\u901f\u6392\u5e8f\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">\uff081\uff09\u7b97\u6cd5\u6d41\u7a0b<\/span><\/p>\n<p><span class=\"bjh-p\">a.\u4ece\u6837\u672c\u5143\u7d20\u4e2d\u9009\u62e9\u4e2d\u95f4\u5143\u7d20\u4f5c\u4e3a\u57fa\u51c6\u503c<\/span><\/p>\n<p><span class=\"bjh-p\">b.\u91cd\u7ec4\u6837\u672c\u987a\u5e8f\uff0c\u5c06\u6240\u6709\u6bd4\u57fa\u51c6\u503c\u5c0f\u7684\u5143\u7d20\u653e\u5728\u57fa\u51c6\u503c\u7684\u5de6\u8fb9\uff0c\u5c06\u6240\u6709\u6bd4\u57fa\u51c6\u503c\u5927\u548c\u76f8\u7b49\u7684\u5143\u7d20\u653e\u5728\u57fa\u51c6\u503c\u7684\u53f3\u8fb9\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u53eb\u505a\u5206\u7ec4<\/span><\/p>\n<p><span class=\"bjh-p\">c.\u4ee5\u9012\u5f52\u7684\u65b9\u5f0f\u5bf9\u5c0f\u4e8e\u57fa\u51c6\u503c\u7684\u5206\u7ec4\u548c\u5927\u4e8e\u57fa\u51c6\u503c\u7684\u5206\u7ec4\u5206\u522b\u91cd\u590d \u4e0a\u8ff0\u8fc7\u7a0b\u8fdb\u884c\u518d\u5206\u7ec4\u6392\u5e8f\uff0c\u76f4\u5230\u6240\u6709\u5143\u7d20\u6709\u5e8f<\/span><\/p>\n<p><span class=\"bjh-p\">\uff082\uff09\u7b97\u6cd5\u8bc4\u4ef7<\/span><\/p>\n<p><span class=\"bjh-p\">\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6O(NlogN)\uff0c\u4e0d\u7a33\u5b9a\uff0c\u5982\u679c\u6bcf\u6b21\u5206\u7ec4\u90fd\u80fd\u505a\u5230\u5747\u5300\u5206\u7ec4\uff0c\u5219\u6392\u5e8f\u901f\u5ea6\u6700\u5feb<\/span><\/p>\n<div class=\"img-container\"><\/div>\n<p><span class=\"bjh-p\">\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e3e\u4f8b\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">\u597d\u4e86\u4eca\u5929\u8981\u548c\u5927\u5bb6\u8ba8\u8bba\u7684\u5c31\u662f\u5982\u4f55\u6bd4\u8f83\u6570\u5b57\u7684\u5927\u5c0f\uff0c\u4f8b\u5982 0,1,2,3,4,5,6,7,8,9\uff1b\u8fd910\u4e2a\u6570\uff0c\u6211\u4eec\u4e00\u773c\u5c31\u53ef\u4ee5\u770b\u51fa\u8fd9\u662f\u4ece\u5c0f\u5230\u5927\u6392\u5217\u7684\uff0c\u4f46\u662f\u5047\u5982\u6211\u7ed9\u4f60\u8fd9\u6837\u51e0\u4e2a\u6570\u4f60\u7ed9\u6211\u4ece\u5c0f\u5230\u5927\u6392\u5217\u51fa\u6765\uff1a11,53,42,66,21,35,64,43,58,67\uff1b<\/span><\/p>\n<p><span class=\"bjh-p\">\u4f60\u770b\u5230\u4e0a\u9762\u8fd9\u51e0\u4e2a\u6570\u4f60\u4f1a\u5982\u4f55\u5c06\u4ed6\u4eec\u6392\u5217\u51fa\u6765\u5462\uff1f\u8ba1\u7b97\u673a\u6240\u6267\u884c\u7684\u4efb\u52a1\uff0c\u5176\u5b9e\u548c\u6211\u4eec\u4eba\u8111\u662f\u4e00\u6837\u7684\uff0c\u4f46\u662f\u4ed6\u662f\u6309\u7167\u6211\u4eec\u6240\u5236\u5b9a\u51fa\u6765\u7684\u89c4\u5219\u8fdb\u884c\u5224\u65ad\u7684\u3002\u6240\u4ee5\u6211\u4eec\u53ea\u9700\u8981\u5c06\u6211\u4eec\u662f\u5982\u4f55\u8fdb\u884c\u5224\u65ad\u7684\u8fc7\u7a0b\u7528C\u8bed\u8a00\u8868\u8ff0\u51fa\u6765\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u6211\u4eec\u77e5\u905311\u662f\u4e0a\u9762\u6570\u636e\u4e2d\u6700\u5c0f\u7684\u90a3\u4e2a\u6570\uff0c\u53ef\u662f\u4f60\u662f\u600e\u4e48\u77e5\u905311\u662f\u6700\u5c0f\u7684\u5462\uff1f\u56e0\u4e3a\u5728\u4f60\u770b\u5230\u8fd9\u4e9b\u6570\u636e\u65f6\uff0c\u4f60\u5df2\u7ecf\u5728\u5927\u8111\u4e2d\u5c0611\u548c\u5176\u4ed6\u6240\u6709\u7684\u6570\u636e\u90fd\u6bd4\u8f83\u4e86\u4e00\u904d\u624d\u5f97\u51fa11\u662f\u6700\u5c0f\u7684\u90a3\u4e2a\u6570\uff0c\u6240\u4ee5\u6211\u4eec\u5199C\u8bed\u8a00\u7a0b\u5e8f\u65f6\u4e5f\u8981\u5c0611\u4f9d\u6b21\u548c\u5176\u4ed6\u7684\u6570\u6bd4\u8f83\u4e00\u6b21\u3002\u63a5\u4e0b\u6765\u7b2c\u4e8c\u4f4d\u6570\u5e94\u8be5\u662f\u4ec0\u4e48\u5462\uff1f\u6211\u8fd9\u4e48\u95ee\u4f60\uff0c\u4f60\u5c31\u5e94\u8be5\u5feb\u901f\u7684\u53bb\u8fdb\u884c\u6bd4\u8f83\uff0c\u53d1\u73b042\u6bd453\u5c0f\uff0c\u6240\u4ee553\u4e0d\u662f\uff1b\u63a5\u4e0b\u6765\u662f66\uff0c\u800c66\u6bd442\u5927\uff0c\u6240\u4ee566\u4e5f\u4e0d\u662f\uff1b\u518d\u63a5\u4e0b\u6765\u662f21,21\u6bd442\u5c0f\uff0c\u6240\u4ee542\u4e0d\u662f,\uff1b\u7136\u540e\u662f35\uff0c35\u6bd421\u5c0f\uff0c\u6240\u4ee535\u4e0d\u662f\uff1b\u3002\u3002\u3002\u3002\u3002\u3002\u5c31\u662f\u8fd9\u6837\u4f9d\u6b21\u6bd4\u8f83\uff0c\u6211\u4eec\u5f97\u51fa21\u662f\u7b2c\u4e8c\u4f4d\u6570\u3002\u7528\u540c\u6837\u7684\u65b9\u6cd5\u6211\u4eec\u53ef\u4ee5\u5f97\u51fa\u63a5\u4e0b\u6765\u7684\u6570\u636e\uff0c \u6700\u7ec8\u6211\u4eec\u6392\u5217\u51fa\u7684\u6570\u636e\u662f\uff1a11,21,35,42,43,53,58,64,66,67\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u800c\u63a5\u4e0b\u6765\u6211\u4eec\u8981\u505a\u7684\u5c31\u662f\u5c06\u4e0a\u9762\u7684\u6267\u884c\u8fc7\u7a0b\u7528C\u8bed\u8a00\u8868\u8ff0\u51fa\u6765\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">void main(void)<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">int bubble[10] = {11,53,42,66,21,35,64,43,58,67}\uff1b \/\/\u58f0\u660e\u6211\u4eec\u8981\u6392\u5e8f\u7684\u6570\u7ec4<\/span><\/p>\n<p><span class=\"bjh-p\">int m = 0; \/\/\u58f0\u660e\u4e00\u4e2a\u4e2d\u95f4\u53d8\u91cf\uff0c\u7528\u6765\u4fdd\u5b58\u8981\u4ea4\u6362\u7684\u6570\u636e<\/span><\/p>\n<p><span class=\"bjh-p\">for(int i = 0; i <\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">for(int j = i + 1;j <\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">if(bubble[i] &gt; bubble[j]) \/\/\u5982\u679c\u5f53\u524d\u7684\u6570\u6bd4\u540e\u9762\u7684\u6570\u636e\u5927\uff0c\u5219\u4ea4\u6362\u4e8c\u8005\u7684\u4f4d\u7f6e<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">m = bubble[i]; \/\/m\u5c31\u662f\u7528\u6765\u4fdd\u5b58\u4e2d\u95f4\u6570\u636e\u7684\u4f5c\u7528<\/span><\/p>\n<p><span class=\"bjh-p\">bubble[i] = bubble[j];<\/span><\/p>\n<p><span class=\"bjh-p\">bubble[j] = m;<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e0a\u9762\u7684\u7b97\u6cd5\u662f\u6bcf\u6b21\u6bd4\u8f83\u51fa\u6700\u5c0f\u7684\u4e00\u4e2a\u6570\u636e\u5e76\u6392\u5217\uff0c\u5c31\u50cf\u662f\u6c14\u6ce1\u4ece\u6c34\u91cc\u5411\u4e0a\u5192\u51fa\u4e00\u6837\uff0c\u6240\u4ee5\u4e5f\u53eb\u5192\u6ce1\u6392\u5e8f\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5f53\u7136\uff0c\u5192\u6ce1\u6392\u5e8f\u6240\u82b1\u8d39\u7684\u6b65\u9aa4\u8f83\u591a\uff0c\u6240\u4ee5\u65f6\u95f4\u4e5f\u82b1\u8d39\u7684\u8f83\u591a\uff0c\u5e76\u4e0d\u662f\u6700\u597d\u7684\u6392\u5e8f\u7b97\u6cd5\uff0c\u5982\u679c\u6570\u7ec4\u5f88\u5927\uff0c\u90a3\u5ef6\u65f6\u611f\u5c31\u5f88\u660e\u663e\uff0c\u5927\u5bb6\u53ef\u4ee5\u8bd5\u7740\u7f16\u5199\u4e00\u4e0b\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u63a5\u4e0b\u6765\u8fd8\u6709\u63d2\u5165\u6392\u5e8f\u3001\u9009\u62e9\u6392\u5e8f\u548c\u5feb\u901f\u6392\u5e8f\uff0c\u5176\u4e2d\u5feb\u901f\u6392\u5e8f\u8f83\u96be\u7406\u89e3\uff0c\u8fd9\u662f\u4e00\u79cd\u4e0d\u662f\u7279\u522b\u7a33\u5b9a\u7684\u6392\u5e8f\u6cd5\uff0c\u5b83\u7684\u6267\u884c\u65f6\u95f4\u53d7\u5230\u5206\u914d\u65b9\u6cd5\u7684\u5236\u7ea6\u3002\u5927\u5bb6\u53ef\u4ee5\u5148\u601d\u8003\u4e00\u4e0b\uff0c\u91cc\u9762\u6709\u7528\u5230\u9012\u5f52\u51fd\u6570\u3002<\/span><\/p>\n<div class=\"img-container\"><\/div>\n<p><span class=\"bjh-p\">C<\/span><\/p>\n<p><span class=\"bjh-p\">\u9012\u5f52\u51fd\u6570\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e00\u4e2a\u51fd\u6570\u5728\u5b83\u7684\u51fd\u6570\u4f53\u5185\u8c03\u7528\u5b83\u81ea\u8eab\u79f0\u4e3a\u9012\u5f52\u8c03\u7528\u3002\u8fd9\u79cd\u51fd\u6570\u79f0\u4e3a\u9012\u5f52\u51fd\u6570\u3002\uff23\u8bed\u8a00\u5141\u8bb8\u51fd\u6570\u7684\u9012\u5f52\u8c03\u7528\u3002\u5728\u9012\u5f52\u8c03\u7528\u4e2d\uff0c\u4e3b\u8c03\u51fd\u6570\u53c8\u662f\u88ab\u8c03\u51fd\u6570\u3002\u6267\u884c\u9012\u5f52\u51fd\u6570\u5c06\u53cd\u590d\u8c03\u7528\u5176\u81ea\u8eab\uff0c\u6bcf\u8c03\u7528\u4e00\u6b21\u5c31\u8fdb\u5165\u65b0\u7684\u4e00\u5c42\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">int f(int x)<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">int y;<\/span><\/p>\n<p><span class=\"bjh-p\">z=f(y);<\/span><\/p>\n<p><span class=\"bjh-p\">return z;<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">\u8fd9\u4e2a\u51fd\u6570\u662f\u4e00\u4e2a\u9012\u5f52\u51fd\u6570\u3002\u4f46\u662f\u8fd0\u884c\u8be5\u51fd\u6570\u5c06\u65e0\u4f11\u6b62\u5730\u8c03\u7528\u5176\u81ea\u8eab\uff0c\u8fd9\u5f53\u7136\u662f\u4e0d\u6b63\u786e\u7684\u3002\u4e3a\u4e86\u9632\u6b62\u9012\u5f52\u8c03\u7528\u65e0\u7ec8\u6b62\u5730\u8fdb\u884c\uff0c\u5fc5\u987b\u5728\u51fd\u6570\u5185\u6709\u7ec8\u6b62\u9012\u5f52\u8c03\u7528\u7684\u624b\u6bb5\u3002\u5e38\u7528\u7684\u529e\u6cd5\u662f\u52a0\u6761\u4ef6\u5224\u65ad\uff0c\u6ee1\u8db3\u67d0\u79cd\u6761\u4ef6\u540e\u5c31\u4e0d\u518d\u4f5c\u9012\u5f52\u8c03\u7528\uff0c\u7136\u540e\u9010\u5c42\u8fd4\u56de\u3002\uff08\u6458\u81ea\u8c2d\u6d69\u5f3aC\u8bed\u8a00\u8bbe\u8ba1\u7b2c\u4e09\u7248\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">\u4f8b\u5982\u7528\u9012\u5f52\u6cd5\u8ba1\u7b97 n!<\/span><\/p>\n<p><span class=\"bjh-p\">\u7528\u9012\u5f52\u6cd5\u8ba1\u7b97 n!\u53ef\u7528\u4e0b\u8ff0\u516c\u5f0f\u8868\u793a\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">n!=1 (n=0,1)<\/span><\/p>\n<p><span class=\"bjh-p\">n\u00d7(n-1)! (n&gt;1)<\/span><\/p>\n<p><span class=\"bjh-p\">\u6309\u516c\u5f0f\u53ef\u7f16\u7a0b\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">long f(int n) \/\/\u5b9a\u4e49\u51fd\u6570f,\u4f20\u9012\u53c2\u6570n;<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">long m; \/\/\u5b9a\u4e49\u53c2\u6570m<\/span><\/p>\n<p><span class=\"bjh-p\">if(n<\/span><\/p>\n<p><span class=\"bjh-p\">else if(n==0||n==1) m=1; \/\/\u5426\u5219\u5224\u65adn\u662f\u5426\u4e3a0\u6216\u80051\uff0c\u4ee4m = 1<\/span><\/p>\n<p><span class=\"bjh-p\">else m=f(n-1)*n; \/\/\uff08\u5982\u679c\u90fd\u4e0d\u662f\u4e0a\u8ff0\u6761\u4ef6\uff0c\u5219m = f(n &#8211; 1) * n;\u5c31\u662f\u8fd9\u91cc\u51fd\u6570f\u81ea\u5df1\u8c03\u7528\u4e86\u81ea\u5df1\uff0c\u53ea\u662f\u4f20\u9012\u7684\u53c2\u6570\u53d8\u6210\u4e86n-1;\u5176\u5b9e\u5c31\u662f\u8fd9\u6837\u5047\u8bbe\u4e00\u5f00\u59cb\u4f20\u9012\u7684n\u7b49\u4e8e10\uff0c\u8fd0\u884c\u5230\u8fd9\u91cc\u5c31\u662fm = f(9) * 10;\u53ef\u662ff(9)\u4e5f\u8981\u6267\u884c\u51fd\u6570\uff0c\u90a3\u5c31\u53d8\u6210\u4e86m =( f(8) * 9) *10;\u540c\u6837f(8)\u4e5f\u8981\u6267\u884c\uff0c\u5c31\u53d8\u6210\u4e86m = (f(7) * 8 * 9 * 10);\u8fd9\u6837\u4f9d\u6b21\u5faa\u73af\u5230f(1)\u65f6\uff0cf(1)\u5c31\u7b49\u4e8e1\uff0c\u4e0d\u4f1a\u518d\u6709\u51fd\u6570f\u51fa\u73b0\u4e86\uff0c\u8fd9\u662f\u51fd\u6570\u6267\u884c\u7684\u662f1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10;\uff09<\/span><\/p>\n<p><span class=\"bjh-p\">return(m); \/\/\u6700\u597d\u8fd4\u56dem;<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">\u4ee5\u4e0a\u7684\u51fd\u6570\u5c31\u662f\u9012\u5f52\uff0c\u5176\u5b9e\u6211\u4e2a\u4eba\u89c9\u5f97\u51fd\u6570\u6709\u70b9\u96be\u7406\u89e3\uff0c\u5f88\u7ed5\u3002\u4f46\u662f\u4ed6\u7684\u529f\u80fd\u8fd8\u662f\u975e\u5e38\u5f3a\u5927\u7684\uff0c\u5927\u5bb6\u53ef\u4ee5\u8bd5\u7740\u53bb\u7406\u89e3\u4e00\u4e0b\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5982\u8457\u540d\u7684\u6c49\u8bfa\u5854\u95ee\u9898\u5c31\u53ef\u4ee5\u7528\u9012\u5f52\u7684\u601d\u60f3\u53bb\u89e3\u51b3\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e00\u5757\u677f\u4e0a\u6709\u4e09\u6839\u9488\uff0cA\uff0cB\uff0cC\u3002A \u9488\u4e0a\u5957\u6709 64 \u4e2a\u5927\u5c0f\u4e0d\u7b49\u7684\u5706\u76d8\uff0c\u5927\u7684\u5728\u4e0b\uff0c\u5c0f\u7684\u5728\u4e0a\u3002\u5982\u4e0b\u56fe\u6240\u793a\u3002\u8981\u628a\u8fd9 64 \u4e2a\u5706\u76d8\u4ece A \u9488\u79fb\u52a8 C \u9488\u4e0a\uff0c\u6bcf\u6b21\u53ea\u80fd\u79fb\u52a8\u4e00\u4e2a\u5706\u76d8\uff0c\u79fb\u52a8\u53ef\u4ee5\u501f\u52a9 B \u9488\u8fdb\u884c\u3002\u4f46\u5728\u4efb\u4f55\u65f6\u5019\uff0c\u4efb\u4f55\u9488\u4e0a\u7684\u5706\u76d8\u90fd\u5fc5\u987b\u4fdd\u6301\u5927\u76d8\u5728\u4e0b\uff0c\u5c0f\u76d8\u5728\u4e0a\u3002\u6c42\u79fb\u52a8\u7684\u6b65\u9aa4\u3002<\/span><\/p>\n<div class=\"img-container\"><\/div>\n<p><span class=\"bjh-p\">\u6c49\u8bfa\u5854<\/span><\/p>\n<p><span class=\"bjh-p\">\u8fd9\u662f\u4e00\u4e2a\u5178\u578b\u7684\u9012\u5f52\u95ee\u9898\uff0c\u5927\u5bb6\u53ef\u4ee5\u5148\u8bd5\u7740\u601d\u8003\u4e00\u4e0b\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">\u672c\u9898\u7b97\u6cd5\u5206\u6790\u5982\u4e0b\uff0c\u8bbe A \u4e0a\u6709 n \u4e2a\u76d8\u5b50\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5982\u679c n=1\uff0c\u5219\u5c06\u5706\u76d8\u4ece A \u76f4\u63a5\u79fb\u52a8\u5230 C\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5982\u679c n=2\uff0c\u5219\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">1.\u5c06 A \u4e0a\u7684 n-1(\u7b49\u4e8e 1)\u4e2a\u5706\u76d8\u79fb\u5230 B \u4e0a\uff1b<\/span><\/p>\n<p><span class=\"bjh-p\">2.\u518d\u5c06 A \u4e0a\u7684\u4e00\u4e2a\u5706\u76d8\u79fb\u5230 C \u4e0a\uff1b<\/span><\/p>\n<p><span class=\"bjh-p\">3.\u6700\u540e\u5c06 B \u4e0a\u7684 n-1(\u7b49\u4e8e 1)\u4e2a\u5706\u76d8\u79fb\u5230 C \u4e0a\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5982\u679c n=3\uff0c\u5219\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">A. \u5c06 A \u4e0a\u7684 n-1(\u7b49\u4e8e 2\uff0c\u4ee4\u5176\u4e3a n`)\u4e2a\u5706\u76d8\u79fb\u5230 B(\u501f\u52a9\u4e8e C)\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">(1)\u5c06 A \u4e0a\u7684 n`-1(\u7b49\u4e8e 1)\u4e2a\u5706\u76d8\u79fb\u5230 C \u4e0a\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">(2)\u5c06 A \u4e0a\u7684\u4e00\u4e2a\u5706\u76d8\u79fb\u5230 B\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">(3)\u5c06 C \u4e0a\u7684 n`-1(\u7b49\u4e8e 1)\u4e2a\u5706\u76d8\u79fb\u5230 B\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">B. \u5c06 A \u4e0a\u7684\u4e00\u4e2a\u5706\u76d8\u79fb\u5230 C\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">C. \u5c06 B \u4e0a\u7684 n-1(\u7b49\u4e8e 2\uff0c\u4ee4\u5176\u4e3a n`)\u4e2a\u5706\u76d8\u79fb\u5230 C(\u501f\u52a9 A)\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">(1)\u5c06 B \u4e0a\u7684 n`-1(\u7b49\u4e8e 1)\u4e2a\u5706\u76d8\u79fb\u5230 A\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">(2)\u5c06 B \u4e0a\u7684\u4e00\u4e2a\u76d8\u5b50\u79fb\u5230 C\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">(3)\u5c06 A \u4e0a\u7684 n`-1(\u7b49\u4e8e 1)\u4e2a\u5706\u76d8\u79fb\u5230 C\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5230\u6b64\uff0c\u5b8c\u6210\u4e86\u4e09\u4e2a\u5706\u76d8\u7684\u79fb\u52a8\u8fc7\u7a0b\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u4ece\u4e0a\u9762\u5206\u6790\u53ef\u4ee5\u770b\u51fa\uff0c\u5f53 n \u5927\u4e8e\u7b49\u4e8e 2 \u65f6\uff0c\u79fb\u52a8\u7684\u8fc7\u7a0b\u53ef\u5206\u89e3\u4e3a\u4e09\u4e2a\u6b65\u9aa4\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">\u7b2c\u4e00\u6b65 \u628a A \u4e0a\u7684 n-1 \u4e2a\u5706\u76d8\u79fb\u5230 B \u4e0a\uff1b<\/span><\/p>\n<p><span class=\"bjh-p\">\u7b2c\u4e8c\u6b65 \u628a A \u4e0a\u7684\u4e00\u4e2a\u5706\u76d8\u79fb\u5230 C \u4e0a\uff1b<\/span><\/p>\n<p><span class=\"bjh-p\">\u7b2c\u4e09\u6b65 \u628a B \u4e0a\u7684 n-1 \u4e2a\u5706\u76d8\u79fb\u5230 C \u4e0a\uff1b\u5176\u4e2d\u7b2c\u4e00\u6b65\u548c\u7b2c\u4e09\u6b65\u662f\u7c7b\u540c\u7684\u3002<\/span><\/p>\n<p><span class=\"bjh-p\">\u5f53 n=3 \u65f6\uff0c\u7b2c\u4e00\u6b65\u548c\u7b2c\u4e09\u6b65\u53c8\u5206\u89e3\u4e3a\u7c7b\u540c\u7684\u4e09\u6b65\uff0c\u5373\u628a n`-1 \u4e2a\u5706\u76d8\u4ece\u4e00\u4e2a\u9488\u79fb\u5230\u53e6\u4e00<\/span><\/p>\n<p><span class=\"bjh-p\">\u4e2a\u9488\u4e0a\uff0c\u8fd9\u91cc\u7684 n`=n-1\u3002 \u663e\u7136\u8fd9\u662f\u4e00\u4e2a\u9012\u5f52\u8fc7\u7a0b\uff0c\u636e\u6b64\u7b97\u6cd5\u53ef\u7f16\u7a0b\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span class=\"bjh-p\">move(int n,int x,int y,int z)<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">if(n==1)<\/span><\/p>\n<p><span class=\"bjh-p\">printf(&#8220;%c&#8211;&gt;%\\n&#8221;,x,z);<\/span><\/p>\n<p><span class=\"bjh-p\">else<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">move(n-1,x,z,y);<\/span><\/p>\n<p><span class=\"bjh-p\">printf(&#8220;%c&#8211;&gt;%\\n&#8221;,x,z);<\/span><\/p>\n<p><span class=\"bjh-p\">move(n-1,y,x,z);<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<p><span class=\"bjh-p\">main()<\/span><\/p>\n<p><span class=\"bjh-p\">{<\/span><\/p>\n<p><span class=\"bjh-p\">int h;<\/span><\/p>\n<p><span class=\"bjh-p\">printf(\\input number\\n&#8221;);<\/span><\/p>\n<p><span class=\"bjh-p\">scanf(&#8220;%d&#8221;,&amp;h);<\/span><\/p>\n<p><span class=\"bjh-p\">printf(&#8220;the step to moving %2d diskes\\n&#8221;,h);<\/span><\/p>\n<p><span class=\"bjh-p\">move(h,&#8217;a&#8217;,&#8217;b&#8217;,&#8217;c&#8217;);<\/span><\/p>\n<p><span class=\"bjh-p\">}<\/span><\/p>\n<div class=\"img-container\"><\/div>\n<p><span class=\"bjh-p\">\u60f3\u8c61\u529b<\/span><\/p>\n<p><span class=\"bjh-p\">\u4eca\u5929\u8bb2\u8ff0\u4e0a\u9762\u7684\u5185\u5bb9\u5176\u5b9e\u5e76\u4e0d\u662f\u60f3\u8981\u4f20\u9012\u591a\u5c11\u77e5\u8bc6\uff0c\u53ea\u662f\u60f3\u544a\u8bc9\u5927\u5bb6\uff0c\u5728\u7f16\u7a0b\u65f6\u4e00\u5b9a\u8981\u201c\u597d\u5b66\u201d\u66f4\u8981\u201c\u597d\u5947\u201d\uff0c\u4f18\u79c0\u7684\u7b97\u6cd5\u90fd\u662f\u6765\u81ea\u5927\u80c6\u7684\u60f3\u8c61\u548c\u5b9e\u9a8c\uff0c\u6240\u4ee5\u5e0c\u671b\u5927\u5bb6\u80fd\u591f\u5f00\u53d1\u81ea\u5df1\u7684\u60f3\u8c61\u529b\uff0c\u53ea\u6709\u8fd9\u6837\u4f60\u624d\u80fd\u6210\u4e3a\u6b63\u771f\u7684\u5927\u725b\uff01<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7a0b\u5e8f\u7684\u7075\u9b42\u662f\u201c\u7b97\u6cd5\u201d\uff0c\u90a3\u4e48\u4ec0\u4e48\u662f\u7b97\u6cd5\uff1f\u6211\u4eec\u6240\u5199\u7684\u7a0b\u5e8f\u90fd\u662f\u6709\u5177\u4f53\u7684\u4efb\u52a1\u8981\u6267\u884c\u7684\uff0c\u4f46\u662f\u53ef\u4ee5\u6709\u591a\u79cd\u65b9\u6cd5\u6765\u8fbe\u5230\u540c\u4e00\u79cd\u76ee [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[70],"class_list":["post-27622","post","type-post","status-publish","format-standard","hentry","category-news","tag-70"],"_links":{"self":[{"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/posts\/27622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/comments?post=27622"}],"version-history":[{"count":0,"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/posts\/27622\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/media?parent=27622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/categories?post=27622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fagao.me\/p\/wp-json\/wp\/v2\/tags?post=27622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}