{"id":9304,"date":"2016-06-07T23:30:12","date_gmt":"2016-06-08T03:30:12","guid":{"rendered":"http:\/\/cscircles.cemc.uwaterloo.ca\/?page_id=9304"},"modified":"2017-06-28T18:55:44","modified_gmt":"2017-06-28T22:55:44","slug":"zh-15b","status":"publish","type":"page","link":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/zh-15b\/","title":{"rendered":"15B: Python \u7ec3\u4e60\u9898"},"content":{"rendered":"<!-- Please retain this notice and add more notes if you create a new version.<br \/>\nOriginal lesson author: David Pritchard, daveagp@gmail.com, http:\/\/cscircles.ca<br \/>\nLicense: http:\/\/creativecommons.org\/licenses\/by-nc-sa\/3.0\/-->\n<p><em>\u7ec3\u4e6015A\u300115B\u548c15C\u4e0d\u5206\u5b66\u4e60\u987a\u5e8f\u3002<\/em><\/p>\n<p>\u5728\u8fd9\u8282\u8bfe\u4e2d\u6709\u51e0\u4e2a\u4e2d\u7b49\u96be\u5ea6\u7684\u7ec3\u4e60\uff0c\u5176\u4e2d\u7ed3\u5408\u4e00\u4e9b\u4e4b\u524d\u6240\u5b66\u7684\u5de5\u5177\u3002<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform0\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox0'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u51ac\u5b63\u7684\u6e29\u5ea6<\/span><\/div>\u5728\u8fd9\u4e2a\u7ec3\u4e60\u4e2d\uff0c\u4f60\u5c06\u521b\u5efa\u4e00\u4e2a\u6e29\u5ea6\u8f6c\u6362\u5668\uff0c\u4f7f\u5f97\u534e\u6c0f\u6e29\u5ea6\u548c\u6444\u6c0f\u5ea6\u4e92\u76f8\u8f6c\u6362\u3002\u4f60\u9700\u8981\u4ee5\u4e0b\u4e24\u4e2a\u8f6c\u6362\u516c\u5f0f\uff08c\u4ee3\u8868\u6444\u6c0f\u5ea6\uff0cf\u4ee3\u8868\u534e\u6c0f\uff09\uff1a<\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7Bf+%3D+c+%5Ctimes+%5Cfrac%7B9%7D%7B5%7D+%2B+32%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle{f = c \\times \\frac{9}{5} + 32}' title='\\displaystyle{f = c \\times \\frac{9}{5} + 32}' class='latex' \/><\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7Bc+%3D+%28f+-32%29%5Ctimes%5Cfrac%7B5%7D%7B9%7D.%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle{c = (f -32)\\times\\frac{5}{9}.}' title='\\displaystyle{c = (f -32)\\times\\frac{5}{9}.}' class='latex' \/><\/p>\n<p>\u8f93\u5165\u662f\u4e00\u4e2a\u7531\u5c0f\u6570\u548c\u5b57\u6bcdF\u6216C\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982 \"<code>13.2C<\/code>\"\u3002\u4f60\u9700\u8981\u5c06\u8f93\u5165\u8f6c\u6362\u5230\u4e0e\u5176\u5bf9\u5e94\u7684\u53e6\u4e00\u4e2a\u6e29\u5ea6\u5355\u4f4d\uff0c\u5e76\u4ee5\u76f8\u540c\u7684\u683c\u5f0f\u6253\u5370\u8f6c\u6362\u503c\u3002\u4f8b\u5982, \u5982\u679c\u8f93\u5165\u662f\"<code>8F<\/code>\" \u90a3\u4e48\u8f93\u51fa\u5c31\u5e94\u8be5\u662f(\u4f30\u8ba1\u503c)<br \/>\n\"<code>-13.333C<\/code>\"\uff1b\u5982\u679c\u8f93\u5165\u4e3a \"<code>12.5C<\/code>\" \u90a3\u4e48\u8f93\u51fa\u5219\u4e3a \"<code>54.5F<\/code>\"\u3002<div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode0' id='usercode0'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory0' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit0' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(0)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(0,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(0,'15b.degrees')\" ><\/td>\n<\/tr><\/table><select id='pbSelect0' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(0);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse0\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"0\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"8ea0bdf887e6d3a45ca56447edab7887\"\/>\n<div id='pbresults0' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(0);});document.getElementById(\"submit0\").value = \"Run program\";document.getElementById(\"inputInUse0\").value = \"N\";<\/script>\n<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform1\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox1'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u4fe1\u7528\u68c0\u67e5<\/span><\/div>\u5047\u8bbe\u4f60\u73b0\u5728\u88ab\u4e00\u5bb6\u94f6\u884c\u96c7\u7528\uff0c\u4f60\u9700\u8981\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\u6765\u68c0\u67e5\u7ed9\u5b9a\u7684\u4fe1\u7528\u5361\u53f7\u7801\u662f\u5426\u6709\u6548\u3002\u7a0b\u5e8f<code>check(S)<\/code> \u7684\u8f93\u5165\u5e94\u4e3a\u5b57\u7b26\u4e32<code>S<\/code>\u3002\u5982\u679c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u6ca1\u6709\u4e0b\u9762\u7684\u683c\u5f0f <code>\"#### #### #### ####\"<\/code> \uff08\u6bcf\u4e2a\u00a0<code>#<\/code> \u4ee3\u8868\u4e00\u4e2a\u6570\u5b57\uff09, \u90a3\u4e48\u5b83\u5e94\u8be5\u8fd4\u8fd8<code>False<\/code>\u3002\u5982\u679c\u6570\u5b57\u4e4b\u548c\u80fd\u88ab10\u6574\u9664\uff08\u201c\u6821\u9a8c\u201d\u7684\u65b9\u6cd5\uff09, \u7136\u540e\u7a0b\u5e8f\u5e94\u8be5\u8fd4\u56de<code>True<\/code>, \u5176\u4ed6\u60c5\u51b5\u4e0b\u7a0b\u5e8f\u90fd\u5e94\u8be5\u8fd4\u8fd8<code>False<\/code>\u3002\u4e3e\u4f8b\u6765\u8bf4\uff0c\u5982\u679c <code>S<\/code> \u662f\u5b57\u7b26\u4e32\u00a0\"<code>9384 3495 3297 0123<\/code>\"\u00a0\u90a3\u4e48\u5c3d\u7ba1\u683c\u5f0f\u662f\u6b63\u786e\u7684\uff0c\u4f46\u6570\u5b57\u4e4b\u548c\u662f72\uff0c\u6240\u4ee5\u4f60\u5e94\u8be5\u8fd4\u8fd8<code>False<\/code>\u3002 <div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode1' id='usercode1'  cols=10 rows=20   class='pyboxCode RW'>\ndef check(S):\n<\/textarea><\/div>\n<div id='pbhistory1' class='flexcontain' style='display:none;'><\/div>\n<input type='hidden' id='defaultCode1' value='def check(S):\\n'><\/input>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit1' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(1)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(1,'Y')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(1,'15b.creditcard')\" ><\/td>\n<\/tr><\/table><select id='pbSelect1' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='default' data-pbonclick=\"pbSetText(1,descape($('#defaultCode1').val()))\" >Reset code to default<\/option>\n<option name='help' data-pbonclick=\"helpClick(1);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse1\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"1\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"92417e8303d44cd23c6bcc806aff78fd\"\/>\n<div id='pbresults1' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(1);});document.getElementById(\"submit1\").value = \"Run program\";document.getElementById(\"inputInUse1\").value = \"N\";<\/script>\n<\/p>\n<p>\u5728\u4e0b\u4e2a\u7ec3\u4e60\u4e2d, \u4f7f\u7528\u00a0<code>string.split()<\/code>\uff0c\u5b83\u53ef\u4ee5\u5220\u9664\u4e00\u4e2a\u5355\u8bcd\u4e2d\u7684\u7a7a\u683c\uff0c\u5e76\u8fd4\u8fd8\u5b83\u6240\u5305\u542b\u7684\u5b57\u6bcd\u7684\u5e8f\u5217\uff1b\u8fd8\u6709<code>string.lower()<\/code>\uff0c\u5b83\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5b57\u7b26\u4e32\u8f6c\u6362\u6210\u5c0f\u5199\u3002\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li><code>\"Split these words!\".split()<\/code> \u4f1a\u8fd4\u56de\u5e8f\u5217\u00a0<code>[\"Split\", \"these\", \"words!\"]<\/code><\/li>\n<li><code>\"LOWERCase\".lower()<\/code> \u4f1a\u8fd4\u56de\u00a0<code>\"lowercase\"<\/code><\/li>\n<\/ul>\n<p>\u6ce8\u610f: <code>split()<\/code> \u8fd8\u53ef\u4ee5\u8fdb\u884c\u5176\u4ed6\u65b9\u5f0f\u5206\u88c2\uff1b\u8bf7\u770b\u6b64 <a href=\"http:\/\/docs.python.org\/py3k\/library\/stdtypes.html#str.split\">\u6587\u6863<\/a>.<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform2\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox2'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u8bd7\u6b4c\u5206\u6790<\/span><\/div>\u4e00\u4f4d\u4f5c\u5bb6\u6b63\u5728\u5199\u6700\u65b0\u7684\u8bd7\uff0c<em>\u56fe\u7075\u548c\u673a\u5668<\/em>\u3002\u8058\u8bf7\u4f60\u6765\u5e2e\u5fd9\u627e\u51fa\u8bd7\u6b4c\u4e2d\u51fa\u73b0\u6b21\u6570\u6700\u591a\u7684\u8fd9\u4e2a\u8bcd\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u53cd\u590d\u8c03\u7528<code>input()<\/code>\u6765\u8bfb\u53d6\u8bd7\u7684\u6bcf\u4e00\u884c\uff0c\u5176\u4e2d\u6700\u540e\u4e00\u884c\u5305\u542b\u4e09\u4e2a\u5b57\u7b26 <code>###<\/code>\u3002\u6bcf\u4e00\u884c\u90fd\u662f\u7531\u5355\u4e2a\u7a7a\u683c\u5206\u9694\u7684\u5355\u8bcd\u7ec4\u6210\u7684\uff0c\u6ca1\u6709\u6570\u5b57\u6216\u6807\u70b9\u7b26\u53f7\u3002\u8bf7\u4f60\u5c06\u6240\u6709\u7684\u5355\u8bcd\u8f6c\u6362\u6210\u5c0f\u5199\uff0c\u5e76<strong>\u6253\u5370\u51fa\u73b0\u6b21\u6570\u6700\u591a\u7684\u90a3\u4e2a\u5355\u8bcd<\/strong>\uff08\u5047\u8bbe\u4e0d\u4f1a\u6709\u591a\u4e2a\u76f8\u540c\u6b21\u6570\u7684\u5355\u8bcd\u51fa\u73b0\uff09\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8f93\u5165\uff1a<\/p>\n<pre>Here is a line like sparkling wine\r\nLine up fast or be the last\r\n###<\/pre>\u90a3\u4e48\u8f93\u51fa\u5e94\u8be5\u662f<\/p>\n<pre>line<\/pre>\u56e0\u4e3a\u5b83\u51fa\u73b0\u4e86\u4e24\u6b21\uff0c\u5176\u4ed6\u5355\u8bcd\u53ea\u51fa\u73b0\u4e86\u4e00\u6b21\u3002<\/p>\n<p><div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode2' id='usercode2'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory2' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit2' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(2)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(2,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(2,'15b.poem')\" ><\/td>\n<\/tr><\/table><select id='pbSelect2' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(2);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse2\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"2\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"d253b4ba9205dca32fd742e2aa453b71\"\/>\n<div id='pbresults2' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(2);});document.getElementById(\"submit2\").value = \"Run program\";document.getElementById(\"inputInUse2\").value = \"N\";<\/script>\n<\/p>\n<p>\u5047\u8bbe\u4f60\u6709<em>n<\/em>\u79cd\u4e0d\u540c\u53e3\u5473\u7684\u51b0\u6fc0\u51cc, \u5e76\u4e14\u60f3\u4f7f\u7528\u6b63\u597d\u5176\u4e2d\u7684<em>k<\/em>\u79cd\u53e3\u5473\u6765\u5236\u4f5c\u4e00\u4e2a\u5723\u4ee3\u3002\u8bf7\u95ee\u4e00\u5171\u6709\u591a\u5c11\u79cd\u4e0d\u540c\u53ef\u80fd\u7684\u53e3\u5473\u6df7\u5408\uff1f\u5047\u8bbe\uff0c\u5982\u679c<em>n<\/em>=4\u548c<em>k<\/em>=2, \u90a3\u4e48\u4e00\u5171\u6709\u516d\u79cd\u53ef\u80fd\uff1a<\/p>\n<p style=\"text-align: center;\">(1) A \u548c B, (2) A \u548c C, (3) A \u548c D, (4) B \u548c C, (5) B \u548c D, (6) C \u548c D.<\/p>\n<p>\u4e0b\u4e00\u4e2a\u95ee\u9898\u662f\u5173\u4e8e\u8fd9\u4e2a\u6570\u5b57\u7684\u8ba1\u7b97\u3002<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform3\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox3'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>n\u9009k<\/span><\/div>\u8ba1\u7b97\u4ece<em>n<\/em>\u79cd\u4e1c\u897f\u4e2d\u9009\u51fa<em>k<\/em>\u79cd\u4e1c\u897f\u7684\u7ec4\u5408\u7684\u516c\u5f0f\u662f<\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7B%5Cfrac%7Bn%7D%7Bk%7D%5Ctimes%5Cfrac%7Bn-1%7D%7Bk-1%7D%5Ctimes%5Ccdots%5Ctimes%5Cfrac%7Bn-k%2B2%7D%7B2%7D%5Ctimes%5Cfrac%7Bn-k%2B1%7D%7B1%7D%7D&#038;bg=T&#038;fg=000000&#038;s=2' alt='\\displaystyle{\\frac{n}{k}\\times\\frac{n-1}{k-1}\\times\\cdots\\times\\frac{n-k+2}{2}\\times\\frac{n-k+1}{1}}' title='\\displaystyle{\\frac{n}{k}\\times\\frac{n-1}{k-1}\\times\\cdots\\times\\frac{n-k+2}{2}\\times\\frac{n-k+1}{1}}' class='latex' \/><\/p>\n<p>\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f<code>choose(n, k)<\/code> \uff0c\u5b83\u4f1a\u6709\u4e24\u4e2a\u6574\u6570\u5b9e\u53c2<code>n<\/code>\u548c<code>k<\/code>; \u5047\u8bbe<em>n<\/em>&gt;<em>k<\/em>&gt;0\u3002\u8fd9\u4e2a\u7a0b\u5e8f\u5e94\u8be5\u8fd4\u56de\u4e0a\u9762\u7ed9\u51fa\u7684\u516c\u5f0f\u7684\u503c\u3002<div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode3' id='usercode3'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory3' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit3' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(3)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(3,'Y')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(3,'15b.choose')\" ><\/td>\n<\/tr><\/table><select id='pbSelect3' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(3);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse3\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"3\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"ce5b4fdebbf8d8eb82c268691c9ab48d\"\/>\n<div id='pbresults3' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(3);});document.getElementById(\"submit3\").value = \"Run program\";document.getElementById(\"inputInUse3\").value = \"N\";<\/script>\n<\/p>\n<p><span style=\"text-align: left;\">\u5728\u6570\u5b66\u4e2d\uff0c\u4f60\u5728\u524d\u9762\u7684\u7ec3\u4e60\u4e2d\u8ba1\u7b97\u7684\u6570\u5b57\u901a\u5e38\u662f\u5199\u6210\u8fd9\u6837\u7684<\/span><\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7B%5Cbinom%7Bn%7D%7Bk%7D%7D&#038;bg=T&#038;fg=000000&#038;s=2' alt='\\displaystyle{\\binom{n}{k}}' title='\\displaystyle{\\binom{n}{k}}' class='latex' \/><\/p>\n<p style=\"text-align: left;\">\u5e76\u88ab\u79f0\u4e3a\"<em>n<\/em>\u9009<em>k<\/em>.\" \u5173\u4e8e\u8fd9\u4e9b\u503c\u6709\u5f88\u591a\u6709\u8da3\u7684\u4e8b\u60c5\uff0c\u4f8b\u5982<\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7B%5Cbinom%7Bn%7D%7Bk%7D+%3D+%5Cbinom%7Bn%7D%7Bn-k%7D%7D&#038;bg=T&#038;fg=000000&#038;s=2' alt='\\displaystyle{\\binom{n}{k} = \\binom{n}{n-k}}' title='\\displaystyle{\\binom{n}{k} = \\binom{n}{n-k}}' class='latex' \/> \u548c <img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7B%5Cbinom%7Bn%7D%7Bk%7D+%3D+%5Cbinom%7Bn-1%7D%7Bk%7D+%2B+%5Cbinom%7Bn-1%7D%7Bk-1%7D%7D&#038;bg=T&#038;fg=000000&#038;s=2' alt='\\displaystyle{\\binom{n}{k} = \\binom{n-1}{k} + \\binom{n-1}{k-1}}' title='\\displaystyle{\\binom{n}{k} = \\binom{n-1}{k} + \\binom{n-1}{k-1}}' class='latex' \/><\/p>\n<p style=\"text-align: left;\">\u8fd9\u662f\u6211\u4eec\u8fd9\u8282\u7ec3\u4e60\u8bfe\u7684\u7ed3\u5c3e\uff0c\u4f60\u53ef\u4ee5\u8fdb\u5165\u4e0b\u4e00\u8282\u8bfe\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ec3\u4e6015A\u300115B\u548c15C\u4e0d\u5206\u5b66\u4e60\u987a\u5e8f\u3002 \u5728\u8fd9\u8282\u8bfe\u4e2d\u6709\u51e0\u4e2a\u4e2d\u7b49\u96be\u5ea6\u7684\u7ec3\u4e60\uff0c\u5176\u4e2d\u7ed3\u5408\u4e00\u4e9b\u4e4b\u524d\u6240\u5b66\u7684\u5de5\u5177\u3002 Coding Exercise: \u51ac\u5b63\u7684\u6e29\u5ea6\u5728\u8fd9\u4e2a\u7ec3\u4e60\u4e2d\uff0c\u4f60\u5c06\u521b\u5efa\u4e00\u4e2a\u6e29\u5ea6\u8f6c\u6362\u5668\uff0c\u4f7f\u5f97\u534e\u6c0f\u6e29\u5ea6\u548c\u6444\u6c0f\u5ea6\u4e92\u76f8\u8f6c\u6362\u3002\u4f60\u9700\u8981\u4ee5\u4e0b\u4e24\u4e2a\u8f6c\u6362\u516c\u5f0f\uff08c\u4ee3\u8868\u6444\u6c0f\u5ea6\uff0cf\u4ee3\u8868\u534e\u6c0f\uff09\uff1a \u8f93\u5165\u662f\u4e00\u4e2a\u7531\u5c0f\u6570\u548c\u5b57\u6bcdF\u6216C\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982 \"13.2C\"\u3002\u4f60\u9700\u8981\u5c06\u8f93\u5165\u8f6c\u6362\u5230\u4e0e\u5176\u5bf9\u5e94\u7684\u53e6\u4e00\u4e2a\u6e29\u5ea6\u5355\u4f4d\uff0c\u5e76\u4ee5\u76f8\u540c\u7684\u683c\u5f0f\u6253\u5370\u8f6c\u6362\u503c\u3002\u4f8b\u5982, \u5982\u679c\u8f93\u5165\u662f\"8F\" \u90a3\u4e48\u8f93\u51fa\u5c31\u5e94\u8be5\u662f(\u4f30\u8ba1\u503c) \"-13.333C\"\uff1b\u5982\u679c\u8f93\u5165\u4e3a \"12.5C\" \u90a3\u4e48\u8f93\u51fa\u5219\u4e3a \"54.5F\"\u3002You need to create an account and log in to ask a question. More actions... Help Coding Exercise: \u4fe1\u7528\u68c0\u67e5\u5047\u8bbe\u4f60\u73b0\u5728\u88ab\u4e00\u5bb6\u94f6\u884c\u96c7\u7528\uff0c\u4f60\u9700\u8981\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\u6765\u68c0\u67e5\u7ed9\u5b9a\u7684\u4fe1\u7528\u5361\u53f7\u7801\u662f\u5426\u6709\u6548\u3002\u7a0b\u5e8fcheck(S) \u7684\u8f93\u5165\u5e94\u4e3a\u5b57\u7b26\u4e32S\u3002\u5982\u679c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u6ca1\u6709\u4e0b\u9762\u7684\u683c\u5f0f \"#### #### #### ####\" \uff08\u6bcf\u4e2a\u00a0# \u4ee3\u8868\u4e00\u4e2a\u6570\u5b57\uff09, \u90a3\u4e48\u5b83\u5e94\u8be5\u8fd4\u8fd8False\u3002\u5982\u679c\u6570\u5b57\u4e4b\u548c\u80fd\u88ab10\u6574\u9664\uff08\u201c\u6821\u9a8c\u201d\u7684\u65b9\u6cd5\uff09, \u7136\u540e\u7a0b\u5e8f\u5e94\u8be5\u8fd4\u56deTrue, &hellip; <a href=\"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/zh-15b\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-9304","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages\/9304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/comments?post=9304"}],"version-history":[{"count":8,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages\/9304\/revisions"}],"predecessor-version":[{"id":10235,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages\/9304\/revisions\/10235"}],"wp:attachment":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/media?parent=9304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}