{"id":266,"date":"2024-11-18T23:59:13","date_gmt":"2024-11-18T15:59:13","guid":{"rendered":"https:\/\/www.meng-xun.top\/?p=266"},"modified":"2024-11-19T12:23:03","modified_gmt":"2024-11-19T04:23:03","slug":"266","status":"publish","type":"post","link":"https:\/\/www.meng-xun.top\/index.php\/2024\/11\/18\/266\/","title":{"rendered":"\u3010\u8d44\u6599\u3011C\u8bed\u8a00\u671f\u4e2d\u590d\u4e60"},"content":{"rendered":"<p><!--more--><\/p>\n<p style=\"padding-left: 40px;\">\u672c\u7ad9<span style=\"color: #ff0000;\">\u4ec5\u9650<\/span>\u4e2a\u4eba\u5b66\u4e60\u548c\u5206\u4eab\u7b14\u8bb0\u4f7f\u7528\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/p>\n<p style=\"padding-left: 40px;\">\u5feb\u8981\u8003\u8bd5\u5566\uff0c\u590d\u4e60\u8d44\u6599\u4eca\u65e5\u4e0a\u65b0\u3002(*^_^*)<\/p>\n<h4>\u57fa\u7840\u77e5\u8bc6\u70b9\uff1a<\/h4>\n<ol>\n<li><ul class='ol'>\n<ol>\u7a0b\u5e8f\u7ed3\u6784\u662f\u4e09\u79cd: \u987a\u5e8f\u7ed3\u6784 , \u5faa\u73af\u7ed3\u6784 (\u4e09\u4e2a\u5faa\u73af\u7ed3\u6784), \u9009\u62e9\u7ed3\u6784 (if \u548c switch)<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u8bfb\u7a0b\u5e8f\u90fd\u8981\u4ecemain()\u5165\u53e3, \u7136\u540e\u4ece\u6700\u4e0a\u9762\u987a\u5e8f\u5f80\u4e0b\u8bfb(\u78b0\u5230\u5faa\u73af\u505a\u5faa\u73af,\u78b0\u5230\u9009\u62e9\u505a\u9009\u62e9)<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u8ba1\u7b97\u673a\u7684\u6570\u636e\u5728\u7535\u8111\u4e2d\u4fdd\u5b58\u662f\u4ee5 \u4e8c\u8fdb\u5236\u7684\u5f62\u5f0f. \u6570\u636e\u5b58\u653e\u7684\u4f4d\u7f6e\u5c31\u662f \u4ed6\u7684\u5730\u5740<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol> bit\u662f\u4f4d \u662f\u6307\u4e3a0 \u6216\u80051\u3002 byte \u662f\u6307\u5b57\u8282, \u4e00\u4e2a\u5b57\u8282 = \u516b\u4e2a\u4f4d<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u4e00\u5b9a\u8981\u8bb0\u4f4f \u4e8c\u8fdb\u5236 \u5982\u4f55\u5212\u6210 \u5341\u8fdb\u5236<\/ol>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<p>&nbsp;<\/p>\n<h4>\u6982\u5ff5\u5e38\u8003\u5230\u7684\uff1a<\/h4>\n<ol>\n<li><ul class='ol'>\n<ol>\u7f16\u8bd1\u9884\u5904\u7406\u4e0d\u662fC\u8bed\u8a00\u7684\u4e00\u90e8\u5206\uff0c\u4e0d\u5360\u8fd0\u884c\u65f6\u95f4\u3002<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>C\u8bed\u8a00\u7f16\u8bd1\u7684\u7a0b\u5e8f\u79f0\u4e3a\u6e90\u7a0b\u5e8f\uff0c\u5b83\u4ee5ASCII\u6570\u503c\u5b58\u653e\u5728\u6587\u672c\u6587\u4ef6\u4e2d\u3002<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u6bcf\u4e2aC\u8bed\u8a00\u7a0b\u5e8f\u4e2dmain\u51fd\u6570\u662f\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u3002<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u5728\u51fd\u6570\u4e2d\u4e0d\u53ef\u4ee5\u518d\u5b9a\u4e49\u51fd\u6570\u3002<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u7b97\u6cd5\u7684\u662f\u4e00\u5b9a\u8981\u6709\u8f93\u51fa\u7684\uff0c\u4ed6\u53ef\u4ee5\u6ca1\u6709\u8f93\u5165\u3002<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>break\u53ef\u7528\u4e8e\u5faa\u73af\u7ed3\u6784\u548cswitch\u8bed\u53e5\u3002<\/ol>\n<\/ul>\n<\/li>\n<li><ul class='ol'>\n<ol>\u9017\u53f7\u8fd0\u7b97\u7b26\u7684\u7ea7\u522b\u6700\u4f4e\u3002<\/ol>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<p>&nbsp;<\/p>\n<h3>\u7b2c\u4e00\u7ae0<\/h3>\n<h4>\u00a01.\u5408\u6cd5\u7684\u7528\u6237\u6807\u8bc6\u7b26\u8003\u67e5\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u5408\u6cd5\u7684\u8981\u6c42\u662f\u7531\u5b57\u6bcd\uff0c\u6570\u5b57\uff0c<span style=\"text-decoration: underline;\">\u4e0b\u5212\u7ebf<\/span>\u7ec4\u6210\u3002<span class=\"badge badge-primary mb-1 mt-1\"><strong>\u6709\u5176\u5b83\u5143\u7d20\u5c31\u9519\u4e86<\/strong><\/span><br \/>\n\u5e76\u4e14\u7b2c\u4e00\u4e2a\u5fc5\u987b\u4e3a\u5b57\u6bcd\u6216\u5219\u662f\u4e0b\u5212\u7ebf\u3002<span class=\"badge badge-primary mb-1 mt-1\">\u7b2c\u4e00\u4e2a\u4e3a\u6570\u5b57\u5c31\u9519\u4e86<\/span><\/p>\n<blockquote><p>\u5173\u952e\u5b57\u4e0d\u53ef\u4ee5\u4f5c\u4e3a\u7528\u6237\u6807\u8bc6\u7b26\u53f7\u3002<\/p>\n<p><code>main<\/code> <code>define<\/code> <code>scanf<\/code> <code>printf<\/code> \u90fd\u4e0d\u662f\u5173\u952e\u5b57\u3002<\/p><\/blockquote>\n<p style=\"padding-left: 40px;\">\u8ff7\u60d1\u4f60\u7684\u5730\u65b9<code>If<\/code>\u662f\u53ef\u4ee5\u505a\u4e3a\u7528\u6237\u6807\u8bc6\u7b26\u3002<\/p>\n<p style=\"padding-left: 40px;\">\u56e0\u4e3a<code>If<\/code>\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u5927\u5199\u4e86\uff0c\u6240\u4ee5\u4e0d\u662f\u5173\u952e\u5b57\u3002<\/p>\n<hr \/>\n<h4>2.\u5b9e\u578b\u6570\u636e\u7684\u5408\u6cd5\u5f62\u5f0f\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">2.333e-1 \u5c31\u662f\u5408\u6cd5\u7684\uff0c\u4e14\u6570\u636e\u662f2.333\u00d710-1\u3002<\/p>\n<div class=\"quote\"><blockquote><p>\u8003\u8bd5\u53e3\u8bc0\uff1ae\u524de\u540e\u5fc5\u6709\u6570\uff0ce\u540e\u5fc5\u4e3a\u6574\u6570\u3002<\/p><cite>&lt;del&gt;\u738b\u667a\u6770&lt;\/del&gt;<\/cite><\/blockquote><\/div>\n<hr \/>\n<h4>\u00a03.\u5b57\u7b26\u6570\u636e\u7684\u5408\u6cd5\u5f62\u5f0f\uff1a<\/h4>\n<p style=\"padding-left: 40px;\"><code>'1'<\/code> \u662f\u5b57\u7b26\u5360\u4e00\u4e2a\u5b57\u8282\uff0c<code>\"1\"<\/code>\u662f\u5b57\u7b26\u4e32\u5360\u4e24\u4e2a\u5b57\u8282(\u542b\u6709\u4e00\u4e2a\u7ed3\u675f\u7b26\u53f7)\u3002<br \/>\n<code> '0'<\/code> \u7684ASCII\u6570\u503c\u8868\u793a\u4e3a48\uff0c<code>'a'<\/code> \u7684ASCII\u6570\u503c\u662f97\uff0c<code>'A'<\/code>\u7684ASCII\u6570\u503c\u662f65\u3002<\/p>\n<hr \/>\n<h4>4.\u6574\u578b\u4e00\u822c\u662f\u4e24\u4e2a\u5b57\u8282, \u5b57\u7b26\u578b\u662f\u4e00\u4e2a\u5b57\u8282\uff0c\u53cc\u7cbe\u5ea6\u4e00\u822c\u662f4\u4e2a\u5b57\u8282\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u8003\u8bd5\u65f6\u5019\u4e00\u822c\u4f1a\u8bf4\uff0c\u572816\u4f4d\u7f16\u8bd1\u7cfb\u7edf\uff0c\u6216\u8005\u662f32\u4f4d\u7cfb\u7edf\u3002\u78b0\u5230\u8fd9\u79cd\u60c5\u51b5\uff0c\u4e0d\u8981\u53bb\u7ba1\uff0c\u4e00\u6837\u505a\u9898\u3002\u638c\u63e1\u6574\u578b\u4e00\u822c\u662f\u4e24\u4e2a\u5b57\u8282, \u5b57\u7b26\u578b\u662f\u4e00\u4e2a\u5b57\u8282\uff0c\u53cc\u7cbe\u5ea6\u4e00\u822c\u662f4\u4e2a\u5b57\u8282\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<hr \/>\n<h4>5.\u8f6c\u4e49\u5b57\u7b26\u7684\u8003\u67e5<\/h4>\n<p style=\"padding-left: 40px;\">\u5728\u7a0b\u5e8f\u4e2d <code>int a = 0x6d<\/code>\u662f\u628a\u4e00\u4e2a\u5341\u516d\u8fdb\u5236\u7684\u6570\u7ed9\u53d8\u91cfa \u6ce8\u610f\u8fd9\u91cc\u76840x\u5fc5\u987b\u5b58\u5728\u3002<br \/>\n\u5728\u7a0b\u5e8f\u4e2d <code>int a = 06d<\/code>\u662f\u4e00\u4e2a\u516b\u8fdb\u5236\u7684\u5f62\u5f0f\u3002<\/p>\n<p style=\"padding-left: 40px;\">\u5728\u8f6c\u4e49\u5b57\u7b26\u4e2d\uff1a<\/p>\n<p style=\"padding-left: 40px;\"><code>\\x6d<\/code>\u624d\u662f\u5408\u6cd5\u7684\uff0c0\u4e0d\u80fd\u5199\uff0c\u5e76\u4e14x\u662f\u5c0f\u5199\u3002<br \/>\n<code>\\141<\/code>\u662f\u5408\u6cd5\u7684\uff0c 0\u662f\u4e0d\u80fd\u5199\u7684\u3002<br \/>\n<code>\\108<\/code>\u662f\u975e\u6cd5\u7684\uff0c\u56e0\u4e3a\u4e0d\u53ef\u4ee5\u51fa\u73b08\u3002<\/p>\n<hr \/>\n<h4>6.\u7b97\u672f\u8fd0\u7b97\u7b26\u53f7\u7684\u4f18\u5148\u7ea7\u522b\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u540c\u7ea7\u522b\u7684\u6709\u7684\u662f\u4ece\u5de6\u5230\u53f3\uff0c\u6709\u7684\u662f\u4ece\u53f3\u5230\u5de6\u3002<\/p>\n<hr \/>\n<h4>7.\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u4e00\u5b9a\u662f <code>\uff08int\uff09a<\/code> \u4e0d\u662f <code>int\uff08a\uff09<\/code>\uff0c\u6ce8\u610f\u7c7b\u578b\u4e0a\u4e00\u5b9a\u6709\u62ec\u53f7\u7684\u3002<br \/>\n\u6ce8\u610f<code>\uff08int\uff09\uff08a+b\uff09<\/code>\u548c<code>\uff08int\uff09a+b<\/code> \u7684\u533a\u522b\u3002 \u524d\u662f\u628aa+b\u8f6c\u578b\uff0c\u540e\u662f\u628aa\u8f6c\u578b\u518d\u52a0b\u3002<\/p>\n<hr \/>\n<h4>8.\u8868\u8fbe\u5f0f\u7684\u8003\u67e5\uff1a<\/h4>\n<blockquote><p>\u662f\u8868\u8fbe\u5f0f\u5c31\u4e00\u5b9a\u6709\u6570\u503c\u3002<\/p><\/blockquote>\n<p style=\"padding-left: 40px;\">\u8d4b\u503c\u8868\u8fbe\u5f0f\uff1a\u8868\u8fbe\u5f0f\u6570\u503c\u662f\u6700\u5de6\u8fb9\u7684\u6570\u503c\uff0c<code>a=b=5<\/code>\u8be5\u8868\u8fbe\u5f0f\u4e3a5\uff0c\u5e38\u91cf\u4e0d\u53ef\u4ee5\u8d4b\u503c\u3002<br \/>\n\u81ea\u52a0\u3001\u81ea\u51cf\u8868\u8fbe\u5f0f\uff1a\u5047\u8bbea=5\uff0c<code>++a<\/code>\uff08\u503c\u4e3a6\uff09\uff0c<code> a++<\/code>\uff08\u503c\u4e3a5\uff09\uff1b<\/p>\n<h4>\u8fd0\u884c\u7684\u673a\u7406\uff1a<\/h4>\n<p style=\"padding-left: 40px;\"><code>++a<\/code> \u662f\u5148\u628a\u53d8\u91cf\u7684\u6570\u503c\u52a0\u4e0a1\uff0c\u7136\u540e\u628a\u5f97\u5230\u7684\u6570\u503c\u653e\u5230\u53d8\u91cf<code>a<\/code>\u4e2d\uff0c\u7136\u540e\u518d\u7528\u8fd9\u4e2a <code>++a<\/code>\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u4e3a6 \uff0c\u800c<code>a++<\/code>\u662f\u5148\u7528\u8be5\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u4e3a5 \uff0c\u7136\u540e\u518d\u628a<code>a<\/code>\u7684\u6570\u503c\u52a0\u4e0a1\u4e3a6\uff0c<br \/>\n\u518d\u653e\u5230\u53d8\u91cfa\u4e2d\u3002 \u8fdb\u884c\u4e86<code>++a<\/code>\u548c<code>a++<\/code>\u540e\u5728\u4e0b\u9762\u7684\u7a0b\u5e8f\u4e2d\u518d\u7528\u5230<code>a<\/code>\u7684\u8bdd\u90fd\u662f\u53d8\u91cf<code>a<\/code>\u4e2d\u76846\u4e86\u3002<\/p>\n<p style=\"padding-left: 40px;\"><div class=\"quote\"><blockquote><p>\u8003\u8bd5\u53e3\u8bc0\uff1a<code>++<\/code>\u5728\u524d\u5148\u52a0\u540e\u7528\uff0c<code>++<\/code>\u5728\u540e\u5148\u7528\u540e\u52a0\u3002<\/p><cite>&lt;del&gt;\u738b\u667a\u6770&lt;\/del&gt;<\/cite><\/blockquote><\/div><\/p>\n<p style=\"padding-left: 40px;\">\u9017\u53f7\u8868\u8fbe\u5f0f\uff1a\u4f18\u5148\u7ea7\u522b\u6700\u4f4e \uff1b\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u9017\u53f7\u6700\u53f3\u8fb9\u7684\u90a3\u4e2a\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u3002<br \/>\n<code>\uff082\uff0c3\uff0c4\uff09<\/code>\u7684\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u5c31\u662f4\u3002<\/p>\n<hr \/>\n<h4>9. \u4f4d\u8fd0\u7b97\u7684\u8003\u67e5\uff1a<\/h4>\n<blockquote><p>\u4f1a\u6709\u4e00\u5230\u4e8c\u9898\u8003\u8bd5\u9898\u76ee\u3002<del>\u8003\u5230\u7b97\u4f60\u4eec\u5012\u9709<\/del><\/p><\/blockquote>\n<p style=\"padding-left: 40px;\">\u603b\u7684\u5904\u7406\u65b9\u6cd5\uff1a\u51e0\u4e4e\u6240\u6709\u7684\u4f4d\u8fd0\u7b97\u7684\u9898\u76ee\u90fd\u8981\u6309\u8fd9\u4e2a\u6d41\u7a0b\u6765\u5904\u7406\uff08\u5148\u628a\u5341\u8fdb\u5236\u53d8\u6210\u4e8c\u8fdb\u5236\u518d\u53d8\u6210\u5341\u8fdb\u5236\uff09\u3002<\/p>\n<pre class=\"prettyprint linenums\">char a = 6, b;<\/p>\n<p>b = a&lt;&lt;2;\u00a0<\/pre>\n<p style=\"padding-left: 40px;\">\u8fd9\u79cd\u9898\u76ee\u7684\u8ba1\u7b97\u662f\u5148\u8981\u628aa\u7684\u5341\u8fdb\u52366\u5316\u6210\u4e8c\u8fdb\u5236\uff0c\u518d\u505a\u4f4d\u8fd0\u7b97\u3002<\/p>\n<hr \/>\n<h4>10.018\u7684\u6570\u503c\u662f\u975e\u6cd5\u7684\uff0c\u516b\u8fdb\u5236\u662f\u6ca1\u67098\u7684\uff0c\u90228\u8fdb1\u3002<\/h4>\n<hr \/>\n<h4>\u00a011.%\u7b26\u53f7\u4e24\u8fb9\u8981\u6c42\u662f\u6574\u6570\u3002\u4e0d\u662f\u6574\u6570\u5c31\u9519\u4e86\u3002<\/h4>\n<hr \/>\n<h4>12.\u53d6\u6574\u4e22\u5c0f\u6570\u7684\u60c5\u51b5\uff1a<\/h4>\n<pre class=\"prettyprint linenums\">int a =1.6\uff1b<\/p>\n<p>(int)a\uff1b\u3000\u3000\/\/\u8be5\u8868\u8fbe\u5f0f\u7684\u503c\u4e3a1<\/pre>\n<hr \/>\n<h3>\u00a0\u7b2c\u4e8c\u7ae0<\/h3>\n<h4>1.<code>printf<\/code>\u51fd\u6570\u7684\u683c\u5f0f\u8003\u67e5\uff1a<\/h4>\n<p style=\"padding-left: 40px;\"><code>%d<\/code>\u5bf9\u5e94\u6574\u578b\uff1b<code>%c<\/code>\u5bf9\u5e94\u5b57\u7b26\uff1b<code>%f<\/code>\u5bf9\u5e94\u5355\u7cbe\u5ea6\uff1b<code>%ld<\/code>\u5bf9\u5e94 <code>long int<\/code>\uff1b<code>%lf`<\/code>\u5bf9\u5e94<code>double<\/code>\u3002<\/p>\n<hr \/>\n<h4>2. <code>scanf<\/code>\u51fd\u6570\u7684\u683c\u5f0f\u8003\u5bdf\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u6ce8\u610f\u8be5\u51fd\u6570\u7684\u7b2c\u4e8c\u4e2a\u90e8\u5206\u662f <code>&amp;a<\/code>\u8fd9\u6837\u7684\u5730\u5740\uff0c\u4e0d\u662f <code>a<\/code>\uff1b <code>Scanf(\u201c%d%d%*d%d\u201d,&amp;a,&amp;b,&amp;c)<\/code>\u8df3\u8fc7\u8f93\u5165\u7684\u7b2c\u4e09\u4e2a\u6570\u636e\u3002<\/p>\n<hr \/>\n<h4>3. <code>putchar<\/code> ,<code>getchar<\/code> \u51fd\u6570\u7684\u8003\u67e5\uff1a<\/h4>\n<p style=\"padding-left: 40px;\"><code>char a = getchar()<\/code>\u662f\u6ca1\u6709\u53c2\u6570\u7684\uff0c\u4ece\u952e\u76d8\u5f97\u5230\u4f60\u8f93\u5165\u7684\u4e00\u4e2a\u5b57\u7b26\u7ed9\u53d8\u91cf<code>a<\/code>\u3002<code> putchar(\u2018y\u2019)<\/code>\u628a\u5b57\u7b26y\u8f93\u51fa\u5230\u5c4f\u5e55\u4e2d\u3002<\/p>\n<hr \/>\n<h4>4. \u5982\u4f55\u5b9e\u73b0\u4e24\u4e2a\u53d8\u91cfx \uff0cy\u4e2d\u6570\u503c\u7684\u4e92\u6362\uff08\u8981\u6c42\u80cc\u4e0b\u6765\uff09<\/h4>\n<pre class=\"prettyprint linenums\">x=y ;<\/p>\n<p>y=x;<\/pre>\n<p style=\"padding-left: 40px;\"><strong>\u8981\u7528\u4e2d\u95f4\u53d8\u91cf<\/strong><\/p>\n<pre class=\"prettyprint linenums\">t=x\uff1b<\/p>\n<p>x=y\uff1b<\/p>\n<p>y=t\uff1b<\/pre>\n<hr \/>\n<h4>5. \u5982\u4f55\u5b9e\u73b0\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\uff0c\u7b2c\u56db\u4f4d\u56db\u820d\u4e94\u5165\u7684\u7a0b\u5e8f\uff0c\uff08\u8981\u6c42\u80cc\u4e0b\u6765\uff09<\/h4>\n<p style=\"padding-left: 40px;\">\u8fd9\u4e2a\u6709\u63a8\u5e7f\u7684\u610f\u4e49\uff0c\u6ce8\u610f <code>x = \uff08int\uff09x<\/code>\u00a0\u8fd9\u6837\u662f\u628a\u5c0f\u6570\u90e8\u5206\u53bb\u6389\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09\u7ae0<\/h3>\n<blockquote><p>\u7279\u522b\u8981\u6ce8\u610f\uff1ac\u8bed\u8a00\u4e2d\u662f\u7528\u975e0\u8868\u793a\u903b\u8f91\u771f\u7684\uff0c\u75280 \u8868\u793a\u903b\u8f91\u5047\u7684\u3002<\/p><\/blockquote>\n<h4>1.\u5173\u7cfb\u8868\u8fbe\u5f0f\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u53ea\u80fd\u4e3a<code>1<\/code>\uff08\u8868\u793a\u4e3a\u771f\uff09\uff0c\u6216<code>0<\/code>\uff08\u8868\u793a\u5047\uff09 \u5f53\u5173\u7cfb\u7684\u8868\u8fbe\u662f\u4e3a\u771f\u7684\u65f6\u5019\u5f97\u5230<code>1<\/code>\u3002\u5982 <code>9&gt;8<\/code>\u8fd9\u662f\u771f\u7684\uff0c\u6240\u4ee5\u8868\u8fbe\u5f0f\u7684\u6570\u503c\u5c31\u662f<code>1<\/code><\/p>\n<hr \/>\n<h4>2. \u903b\u8f91\u8868\u8fbe\u5f0f\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u53ea\u80fd\u4e3a<code>1<\/code>\uff08\u8868\u793a\u4e3a\u771f\uff09\uff0c\u6216<code>0<\/code>\uff08\u8868\u793a\u5047\uff09<\/p>\n<ul>\n<li>\u5171\u6709<code>&amp;&amp;<\/code> <code>||<\/code> <code>\uff01<\/code> \u4e09\u79cd\u903b\u8f91\u8fd0\u7b97\u7b26\u53f7\u3002<\/li>\n<li><code>\uff01<\/code>&gt;<code>&amp;&amp;<\/code>&gt;<code>||<\/code> \u4f18\u5148\u7684\u7ea7\u522b\u3002<\/li>\n<li>\u6ce8\u610f\u77ed\u8def\u73b0\u8c61\uff0c\u8003\u8bd5\u6bd4\u8f83\u559c\u6b22\u8003\u5230\u3002<\/li>\n<li>\u8981\u8868\u793a x \u662f\u6bd40\u5927\uff0c\u6bd410\u5c0f\u7684\u65b9\u6cd5\u3002 <code>0&lt;x&lt;10<\/code>\u662f\u4e0d\u53ef\u4ee5\u7684\uff08\u4e00\u5b9a\u8bb0\u4f4f\uff09<\/li>\n<li>\u56e0\u4e3a\u662f\u5148\u8ba1\u7b970\u548cx\u7684\u5927\u5c0f\uff0c\u7ed3\u679c\u4e3a1\u6216\u80050\uff0c\u518d\u6bd4\u8f831\u6216\u80050\u548c10\u7684\u5927\u5c0f<br \/>\n<hr \/>\n<\/li>\n<\/ul>\n<h4>3. if \u8bed\u53e5<\/h4>\n<p style=\"padding-left: 40px;\"><code>else<\/code> \u662f\u4e0e\u6700\u63a5\u8fd1\u7684<code>if<\/code>\u4e14\u6ca1\u6709<code>else<\/code>\u7684\u76f8\u7ec4\u5408\u7684\u3002<\/p>\n<hr \/>\n<h4>4. \u6761\u4ef6\u8868\u8fbe\u5f0f\uff1a<\/h4>\n<pre class=\"prettyprint linenums\">\u8868\u8fbe\u5f0f1 \uff1f\u8868\u8fbe\u5f0f2 \uff1a\u8868\u8fbe\u5f0f3<\/pre>\n<p style=\"padding-left: 40px;\">\u6ce8\u610f\u662f\u5f53<code>\u8868\u8fbe\u5f0f1<\/code>\u7684\u503c\u4e3a1 \u65f6\u5019\u662f<code>\u8868\u8fbe\u5f0f2<\/code>\u7684\u6570\u503c\uff0c\u5f53<code>\u8868\u8fbe\u5f0f1<\/code>\u7684\u503c\u4e3a0\u662f\u5c31\u662f<code>\u8868\u8fbe\u5f0f2<\/code>\u7684\u6570\u503c\u3002<\/p>\n<div class=\"quote\"><blockquote><p>\u8003\u8bd5\u53e3\u8bc0\uff1a\u8003\u8bd5\u53e3\u8bc0\uff1a\u771f\u524d\u5047\u540e<\/p><cite>&lt;del&gt;\u738b\u667a\u6770&lt;\/del&gt;<\/cite><\/blockquote><\/div>\n<hr \/>\n<h4>5. switch\u8bed\u53e5<\/h4>\n<ul>\n<li>\u4e00\u5b9a\u8981\u6ce8\u610f \u6709<code>break<\/code> \u548c\u6ca1\u6709<code>break<\/code>\u7684\u5dee\u522b\uff0c\u4e66\u4e0a\uff0834\u9875\uff09\u7684\u4e24\u4e2a\u4f8b\u5b50\uff0c\u6ca1\u6709<code>break<\/code>\u65f6\u5019\uff0c\u53ea\u8981\u6709\u4e00\u4e2a<code>case<\/code>\u5339\u914d\u4e86\uff0c\u5269\u4e0b\u7684\u90fd\u8981\u6267\u884c\uff0c\u6709<code>break<\/code>\u5219\u662f\u76f4\u63a5\u8df3\u51fa\u4e86<code>swiche<\/code>\u8bed\u53e5\u3002<\/li>\n<li><code>switch<\/code>\u53ea\u53ef\u4ee5\u548c<code>break<\/code>\u4e00\u8d77\u7528\uff0c\u4e0d\u53ef\u4ee5\u548c<code>continue<\/code>\u7528\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u56db\u7ae0<\/h3>\n<h4>1. \u4e09\u79cd\u5faa\u73af\u7ed3\u6784\uff1a<\/h4>\n<ul>\n<li><code>for\uff08\uff09<\/code>\u00a0 <code>while()do- while()<\/code>\u4e09\u79cd\u3002<\/li>\n<li><code>for<\/code>\u5faa\u73af\u5f53\u4e2d\u5fc5\u987b\u662f\u4e24\u4e2a\u5206\u53f7\uff0c\u5343\u4e07\u4e0d\u8981\u5fd8\u8bb0\u3002<\/li>\n<li>\u5199\u7a0b\u5e8f\u7684\u65f6\u5019\u4e00\u5b9a\u8981\u6ce8\u610f\uff0c\u5faa\u73af\u4e00\u5b9a\u8981\u6709\u7ed3\u675f\u7684\u6761\u4ef6\uff0c\u5426\u5219\u6210\u4e86\u6b7b\u5faa\u73af\u3002<\/li>\n<li><code>do-while()<\/code>\u5faa\u73af\u7684\u6700\u540e\u4e00\u4e2a<code>while();<\/code>\u7684\u5206\u53f7\u4e00\u5b9a\u4e0d\u80fd\u591f\u4e22\u3002\uff08\u5f53\u5fc3\u4e0a\u673a\u6539\u9519\uff09<\/li>\n<\/ul>\n<hr \/>\n<h4>2. break \u548c continue\u7684\u5dee\u522b<\/h4>\n<h4 style=\"padding-left: 40px;\">\u8bb0\u5fc6\u65b9\u6cd5\uff1a<\/h4>\n<ul>\n<li><code>break<\/code>\uff1a\u662f\u6253\u7834\u7684\u610f\u601d\uff0c\uff08\u7834\u4e86\u6574\u4e2a\u5faa\u73af\uff09\u6240\u4ee5\u770b\u89c1b<code>reak<\/code>\u5c31\u9000\u51fa\u771f\u4e2a\u4e00\u5c42\u5faa\u73af\u3002<\/li>\n<li><code>continue<\/code>\uff1a\u662f\u7ee7\u7eed\u7684\u610f\u601d\uff0c\uff08\u7ee7\u7eed\u5faa\u73af\u8fd0\u7b97\uff09\uff0c\u4f46\u662f\u8981\u7ed3\u675f\u672c\u6b21\u5faa\u73af\uff0c\u5c31\u662f\u5faa\u73af\u4f53\u5185\u5269\u4e0b\u7684\u8bed\u53e5\u4e0d\u518d\u6267\u884c\uff0c\u8df3\u5230\u5faa\u73af\u5f00\u59cb\uff0c\u7136\u540e\u5224\u65ad\u5faa\u73af\u6761\u4ef6\uff0c\u8fdb\u884c\u65b0\u4e00\u8f6e\u7684\u5faa\u73af\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>3. \u5d4c\u5957\u5faa\u73af<\/h4>\n<p style=\"padding-left: 40px;\">\u5c31\u662f\u6709\u5faa\u73af\u91cc\u9762\u8fd8\u6709\u5faa\u73af\uff0c\u8fd9\u79cd\u6bd4\u8f83\u590d\u6742\uff0c\u8981\u4e00\u5c42\u4e00\u5c42\u4e00\u6b65\u4e00\u6b65\u8010\u5fc3\u7684\u8ba1\u7b97\uff0c\u4e00\u822c\u8bb0\u4f4f\u4e24\u5c42\u662f\u5904\u7406\u4e8c\u7ef4\u6570\u7ec4\u7684\u3002<\/p>\n<hr \/>\n<h4>4. <code>while\uff08\uff08c=getchar()\uff09!=\u2019\\n\u2019\uff09<\/code>\u548c <code>while\uff08c=getchar() !=\u2019\\n\u2019\uff09<\/code>\u7684\u5dee\u522b<\/h4>\n<p style=\"padding-left: 40px;\">\u5148\u770b<code>a = 3 != 2<\/code> \u548c<code>\uff08a=3\uff09\uff01=2<\/code> \u7684\u533a\u522b\uff1a<br \/>\n\uff08<code>\uff01=<\/code>\u7684\u7ea7\u522b\u9ad8\u4e8e<code>=<\/code>\u00a0\u6240\u4ee5\u7b2c\u4e00\u4e2a\u5148\u8ba1\u7b97 <code>3\uff01=2<\/code>\uff09<br \/>\n\u7b2c\u4e00\u4e2a<code>a<\/code>\u7684\u6570\u503c\u662f\u5f97\u5230\u76841\uff1b\u7b2c\u4e8c\u4e2a<code>a<\/code>\u7684\u6570\u503c\u662f3\u3002<br \/>\n\u8003\u8bd5\u6ce8\u610f\u70b9: \u62ec\u53f7\u5728\u8fd9\u91cc\u7684\u91cd\u8981\u6027\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e94\u7ae0<\/h3>\n<blockquote><p>\u51fd\u6570\uff1a\u662f\u5177\u6709\u4e00\u5b9a\u529f\u80fd\u7684\u4e00\u4e2a\u7a0b\u5e8f\u5757<\/p><\/blockquote>\n<h4>1. \u51fd\u6570\u7684\u53c2\u6570\uff0c\u8fd4\u56de\u6570\u503c\uff1a<\/h4>\n<pre class=\"prettyprint linenums\">main()<\/p>\n<p>{<\/p>\n<p>int a = 5,b=6,c;<\/p>\n<p>c = add(a,b);<\/p>\n<p>printf(\u201c%d\u201d,c);<\/p>\n<p>}<\/p>\n<p>\/\/\u8c03\u7528\u51fd\u6570add<\/p>\n<p>\/\/a,b\u662f\u5b9e\u53c2<\/p>\n<p>\/\/\u6574\u4e2a\u51fd\u6570\u5f97\u5230\u4e00\u4e2a\u6570\u503c\u5c31\u662fAdd\u51fd\u6570\u7684\u8fd4\u56de\u6570\u503c\u3002<\/p>\n<p>int add ( int x, int y)<\/p>\n<p>{<\/p>\n<p>int z;<\/p>\n<p>z=x+y;<\/p>\n<p>return z;<\/p>\n<p>}<\/p>\n<p>\/\/\u88ab\u8c03\u7528\u51fd\u6570<\/p>\n<p>\/\/x\uff0cy\u662f\u5f62\u5f0f\u53c2\u6570<\/p>\n<p>\/\/\u51fd\u6570\u8fd4\u56de\u6570\u503c\u662f\u6574\u578b<\/pre>\n<p style=\"padding-left: 40px;\"><code>z<\/code>\u5c31\u662f\u8fd9\u4e2a<code>add<\/code>\u51fd\u6570\u8ba1\u7b97\u540e\u5f97\u5230\u7684\u7ed3\u679c\uff0c\u5c31\u662f\u51fd\u6570\u8fd4\u56de\u7ed9\u4e3b\u7a0b\u5e8f\u7684\u8fd4\u56de\u6570\u503c\u3002<br \/>\n\u7a0b\u5e8f\u662f\u5728\u4ece\u4e0a\u5f80\u4e0b\u987a\u5e8f\u6267\u884c\uff0c\u5f53\u78b0\u5230\u4e86\u51fd\u6570<code>add<\/code>\u540e\uff0c\u628a<code>a<\/code>\uff0c<code>b<\/code>\u7684\u6570\u503c\u7a7f\u7ed9\u8c03\u7528\u51fd\u6570\uff0c\u7a0b\u5e8f\u6682\u65f6\u4e2d\u65ad\u7b49\u5f85\u8fd4\u56de\u6570\u503c\u3002\u5f53\u5f97\u5230\u4e86\u8fd4\u56de\u6570\u503c\u540e\uff0c\u518d\u987a\u5e8f\u7684\u5f80\u4e0b\u6267\u884c<\/p>\n<hr \/>\n<h4>2. \u4e00\u5b9a\u8981\u6ce8\u610f\u53c2\u6570\u4e4b\u95f4\u7684\u4f20\u9012<\/h4>\n<p style=\"padding-left: 40px;\">\u5b9e\u53c2\u548c\u5f62\u53c2\u4e4b\u95f4 \u4f20\u6570\u503c\uff0c\u548c\u4f20\u5730\u5740\u7684\u5dee\u522b\u3002\uff08\u8003\u8bd5\u7684\u91cd\u70b9\uff09<br \/>\n\u4f20\u6570\u503c\u7684\u8bdd\uff0c\u5f62\u53c2\u7684\u53d8\u5316\u4e0d\u4f1a\u6539\u53d8\u5b9e\u53c2\u7684\u53d8\u5316\u3002<br \/>\n\u4f20\u5730\u5740\u7684\u8bdd\uff0c\u5f62\u53c2\u7684\u53d8\u5316\u5c31\u4f1a\u6709\u53ef\u80fd\u6539\u53d8\u5b9e\u53c2\u7684\u53d8\u5316\u3002<\/p>\n<hr \/>\n<h4>3. \u51fd\u6570\u58f0\u660e\u7684\u8003\u67e5\uff1a<\/h4>\n<p style=\"padding-left: 40px;\">\u4e00\u5b9a\u8981\u6709\uff1a<code>\u51fd\u6570\u540d \u51fd\u6570\u7684\u8fd4\u56de\u7c7b\u578b \u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b<\/code><br \/>\n\u4e0d\u4e00\u5b9a\u8981\u6709\uff1a<code>\u5f62\u53c2\u7684\u540d\u79f0<\/code><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[17,18],"class_list":["post-266","post","type-post","status-publish","format-standard","hentry","category-6","tag-17","tag-18"],"_links":{"self":[{"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/posts\/266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/comments?post=266"}],"version-history":[{"count":17,"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":283,"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/posts\/266\/revisions\/283"}],"wp:attachment":[{"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/media?parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/categories?post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.meng-xun.top\/index.php\/wp-json\/wp\/v2\/tags?post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}