{"id":57861,"date":"2025-08-15T21:30:02","date_gmt":"2025-08-15T13:30:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/57861.html"},"modified":"2025-08-15T21:30:02","modified_gmt":"2025-08-15T13:30:02","slug":"c%e8%af%ad%e8%a8%80%e8%87%aa%e5%ad%a6-c%e8%af%ad%e8%a8%80%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e5%92%8c%e5%8f%98%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/57861.html","title":{"rendered":"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf"},"content":{"rendered":"<h4 style=\"background-color:transparent\"><span style=\"color:#0d0016\">1. \u6570\u636e\u7c7b\u578b\u4ecb\u7ecd<\/span><\/h4>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0C\u8bed\u8a00\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u5305\u62ec\u6574\u578b\u3001\u6d6e\u70b9\u578b\u548c\u5b57\u7b26\u578b\u3002\u6574\u578b\u7528\u4e8e\u5b58\u50a8\u6574\u6570&#xff0c;\u6d6e\u70b9\u578b\u7528\u4e8e\u5b58\u50a8\u5c0f\u6570&#xff0c;\u5b57\u7b26\u578b\u7528\u4e8e\u5b58\u50a8\u5355\u4e2a\u5b57\u7b26\u3002\u4e0b\u9762\u76d8\u70b9\u4e00\u4e0bC\u8bed\u8a00\u63d0\u4f9b\u7684\u5404\u79cd\u6570\u636e\u7c7b\u578b&#xff0c;\u672c\u7ae0\u8282\u4e3b\u8981\u63a2\u8ba8\u5185\u7f6e\u6570\u636e\u7c7b\u578b\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"642\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815132955-689f3653283aa.png\" width=\"1155\" \/><\/span><\/p>\n<h6><span style=\"color:#0d0016\">1.1\u3001\u5b57\u7b26\u578b<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5b57\u7b26\u578b&#xff08;char&#xff09;\u662fC\u8bed\u8a00\u4e2d\u7528\u4e8e\u5b58\u50a8\u5355\u4e2a\u5b57\u7b26\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u5360\u75281\u5b57\u8282\u5185\u5b58\u7a7a\u95f4\u3002\u5b57\u7b26\u578b\u53d8\u91cf\u5b9e\u9645\u5b58\u50a8\u7684\u662f\u5bf9\u5e94\u5b57\u7b26\u7684ASCII\u7801\u503c&#xff08;\u6574\u6570&#xff09;&#xff0c;\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u53c2\u4e0e\u6574\u6570\u8fd0\u7b97\u3002<\/span><\/p>\n<p>char<br \/>\n [signed] char<br \/>\n unsigned char<\/p>\n<p>char ch1 &#061; &#039;A&#039;;      \/\/ \u76f4\u63a5\u8d4b\u503c\u5b57\u7b26<br \/>\nchar ch2 &#061; 65;       \/\/ \u4f7f\u7528ASCII\u7801\u8d4b\u503c&#xff08;\u5341\u8fdb\u5236&#xff09;<br \/>\nchar ch3 &#061; &#039;\\\\x41&#039;;   \/\/ \u4f7f\u7528ASCII\u7801\u8d4b\u503c&#xff08;\u5341\u516d\u8fdb\u5236&#xff09;<br \/>\nchar ch4 &#061; &#039;\\\\101&#039;;   \/\/ \u4f7f\u7528ASCII\u7801\u8d4b\u503c&#xff08;\u516b\u8fdb\u5236&#xff09;<\/p>\n<h6><span style=\"color:#0d0016\">1.2\u3001\u6574\u578b<\/span><\/h6>\n<p>\/\/\u77ed\u6574\u578b<br \/>\nshort [int]<br \/>\n[signed] short [int]<br \/>\nunsigned short [int]<\/p>\n<p>\/\/\u6574\u578b<br \/>\nint[signed] int<br \/>\nunsigned int<\/p>\n<p>\/\/\u2ed3\u6574\u578b<br \/>\nlong [int]<br \/>\n[signed] long [int]<br \/>\nunsigned long [int]<\/p>\n<p>\/\/\u66f4\u2ed3\u7684\u6574\u578b<br \/>\n\/\/C99\u4e2d\u5f15\u2f0a<br \/>\nlong long [int]<br \/>\n[signed] long long [int]<br \/>\nunsigned long long [int]<\/p>\n<h6><span style=\"color:#0d0016\">1.2.1\u7c7b\u578b\u4fee\u9970\u7b26<\/span><\/h6>\n<li>\n<p><span style=\"color:#0d0016\">signed<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u663e\u5f0f\u58f0\u660e\u4e3a\u6709\u7b26\u53f7\u6574\u578b&#xff08;\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;int\u3001short\u3001long\u7b49\u4e3a\u6709\u7b26\u53f7&#xff09;\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u793a\u4f8b&#xff1a;signed int i &#061; -10;<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">unsigned<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u58f0\u660e\u4e3a\u65e0\u7b26\u53f7\u6574\u578b&#xff0c;\u53ea\u80fd\u8868\u793a\u975e\u8d1f\u6570\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u793a\u4f8b&#xff1a;unsigned int j &#061; 10;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7\u6574\u578b\u53ea\u80fd\u8868\u793a\u975e\u8d1f\u6570&#xff0c;\u8303\u56f4\u662f\u76f8\u5e94\u6709\u7b26\u53f7\u6574\u578b\u7684\u975e\u8d1f\u90e8\u5206\u7684\u4e24\u500d\u3002<\/span><\/li>\n<\/ul>\n<\/li>\n<h6><span style=\"color:#0d0016\">1.3\u3001\u6d6e\u70b9\u578b<\/span><\/h6>\n<p>float<br \/>\ndouble<br \/>\nlong double<\/p>\n<h6><span style=\"color:#0d0016\">1.3.1\u3001\u6d6e\u70b9\u578b\u6570\u636e\u7c7b\u578b<\/span><\/h6>\n<p><span style=\"color:#0d0016\">C\u8bed\u8a00\u4e2d\u7684\u6d6e\u70b9\u578b\u7528\u4e8e\u8868\u793a\u5c0f\u6570\u6216\u5b9e\u6570&#xff0c;\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u4e09\u79cd\u7c7b\u578b&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">float&#xff1a;\u5355\u7cbe\u5ea6\u6d6e\u70b9\u578b&#xff0c;\u5360\u75284\u5b57\u8282&#xff08;32\u4f4d&#xff09;&#xff0c;\u7cbe\u5ea6\u7ea66-7\u4f4d\u5c0f\u6570\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">double&#xff1a;\u53cc\u7cbe\u5ea6\u6d6e\u70b9\u578b&#xff0c;\u5360\u75288\u5b57\u8282&#xff08;64\u4f4d&#xff09;&#xff0c;\u7cbe\u5ea6\u7ea615-16\u4f4d\u5c0f\u6570\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">long double&#xff1a;\u6269\u5c55\u7cbe\u5ea6\u6d6e\u70b9\u578b&#xff0c;\u901a\u5e38\u5360\u752810\u5b57\u8282&#xff08;80\u4f4d&#xff09;\u6216\u66f4\u591a&#xff0c;\u5177\u4f53\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668\u3002<\/span><\/li>\n<\/ul>\n<h6><span style=\"color:#0d0016\">1.3.2\u3001\u6d6e\u70b9\u578b\u58f0\u660e\u4e0e\u521d\u59cb\u5316<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u6d6e\u70b9\u578b\u53d8\u91cf\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u58f0\u660e\u548c\u521d\u59cb\u5316&#xff1a;<\/span><\/p>\n<p>float a &#061; 3.14f;      \/\/ \u6ce8\u610f\u540e\u7f00&#039;f&#039;\u8868\u793afloat\u7c7b\u578b<br \/>\ndouble b &#061; 2.71828;   \/\/ \u9ed8\u8ba4\u6d6e\u70b9\u5e38\u91cf\u662fdouble\u7c7b\u578b<br \/>\nlong double c &#061; 1.41421356L; \/\/ \u540e\u7f00&#039;L&#039;\u8868\u793along double<\/p>\n<h6><span style=\"color:#0d0016\">1.3.3\u3001\u6d6e\u70b9\u578b\u5e38\u91cf\u8868\u793a<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u6d6e\u70b9\u578b\u5e38\u91cf\u652f\u6301\u79d1\u5b66\u8ba1\u6570\u6cd5&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5341\u8fdb\u5236\u5f62\u5f0f&#xff1a;3.14\u30010.001<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6307\u6570\u5f62\u5f0f&#xff1a;1.23e-4&#xff08;\u8868\u793a1.23\u00d710\u207b\u2074&#xff09;<\/span><\/li>\n<\/ul>\n<h6><span style=\"color:#0d0016\">1.3.4\u3001\u6d6e\u70b9\u578b\u7cbe\u5ea6\u4e0e\u8303\u56f4<\/span><\/h6>\n<ul>\n<li><span style=\"color:#0d0016\">float&#xff1a;\u8303\u56f4\u7ea6\u00b11.2\u00d710\u207b\u00b3\u2078\u5230\u00b13.4\u00d710\u00b3\u2078\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">double&#xff1a;\u8303\u56f4\u7ea6\u00b12.3\u00d710\u207b\u00b3\u2070\u2078\u5230\u00b11.7\u00d710\u00b3\u2070\u2078\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">long double&#xff1a;\u8303\u56f4\u901a\u5e38\u66f4\u5927&#xff0c;\u5177\u4f53\u53d6\u51b3\u4e8e\u5b9e\u73b0\u3002<\/span><\/li>\n<\/ul>\n<h6><span style=\"color:#0d0016\">1.3.5\u3001\u6d6e\u70b9\u578b\u7684\u6ce8\u610f\u4e8b\u9879<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u6d6e\u70b9\u578b\u8fd0\u7b97\u53ef\u80fd\u5b58\u5728\u7cbe\u5ea6\u8bef\u5dee&#xff0c;\u4f8b\u5982&#xff1a;<\/span><\/p>\n<p>float x &#061; 0.1f &#043; 0.2f;<br \/>\nprintf(&#034;%.20f\\\\n&#034;, x); \/\/ \u8f93\u51fa\u53ef\u80fd\u4e0d\u662f\u7cbe\u786e\u76840.3<\/p>\n<p><span style=\"color:#0d0016\">\u6bd4\u8f83\u6d6e\u70b9\u6570\u65f6\u5e94\u4f7f\u7528\u8bef\u5dee\u8303\u56f4&#xff08;\u5982fabs(a &#8211; b) &lt; 1e-6&#xff09;\u3002<\/span><\/p>\n<h6><span style=\"color:#0d0016\">1.3.6\u3001\u5e38\u7528\u6570\u5b66\u51fd\u6570<\/span><\/h6>\n<p><span style=\"color:#0d0016\">C\u6807\u51c6\u5e93&lt;math.h&gt;\u63d0\u4f9b\u6d6e\u70b9\u8fd0\u7b97\u51fd\u6570&#xff1a;<\/span><\/p>\n<p>#include &lt;math.h&gt;<br \/>\ndouble sqrt(double x);      \/\/ \u5e73\u65b9\u6839<br \/>\ndouble pow(double x, double y); \/\/ \u5e42\u8fd0\u7b97<br \/>\ndouble sin(double x);       \/\/ \u4e09\u89d2\u51fd\u6570<\/p>\n<h6><span style=\"color:#0d0016\">1.4\u3001\u5e03\u5c14\u7c7b\u578b<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0C\u8bed\u8a00\u539f\u6765\u5e76\u6ca1\u6709\u4e3a\u5e03\u5c14\u503c\u5355\u72ec\u8bbe\u7f6e\u2f00\u4e2a\u7c7b\u578b&#xff0c;\u800c\u662f\u4f7f\u7528\u6574\u6570 \u5728 C99 \u4e2d\u4e5f\u5f15\u5165\u4e86 \u5e03\u5c14\u7c7b\u578b&#xff0c;\u662f\u4e13\u95e8\u8868\u793a\u771f\u5047\u7684\u3002\u4eceC99\u6807\u51c6\u5f00\u59cb&#xff0c;C\u8bed\u8a00\u5f15\u5165\u4e86_Bool\u5173\u952e\u5b57\u548c&lt;stdbool.h&gt;\u5934\u6587\u4ef6&#xff0c;\u63d0\u4f9b\u4e86\u66f4\u76f4\u89c2\u7684\u5e03\u5c14\u7c7b\u578b\u652f\u6301\u3002<\/span><\/p>\n<p>#include &lt;stdbool.h&gt;<\/p>\n<p>bool flag &#061; true;  \/\/ \u5b9a\u4e49\u5e03\u5c14\u53d8\u91cf\u5e76\u521d\u59cb\u5316\u4e3a\u771f<br \/>\nflag &#061; false;      \/\/ \u4fee\u6539\u4e3a\u5047<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5e03\u5c14\u503c\u53ef\u4ee5\u53c2\u4e0e\u903b\u8f91\u8fd0\u7b97&#xff1a;<\/span><\/p>\n<p>bool a &#061; true, b &#061; false;<br \/>\nbool c &#061; a &amp;&amp; b;  \/\/ \u903b\u8f91\u4e0e<br \/>\nbool d &#061; a || b;  \/\/ \u903b\u8f91\u6216<br \/>\nbool e &#061; !a;      \/\/ \u903b\u8f91\u975e<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5f53\u5176\u4ed6\u7c7b\u578b\u8f6c\u6362\u4e3a\u5e03\u5c14\u7c7b\u578b\u65f6&#xff0c;\u96f6\u503c\u8f6c\u4e3afalse&#xff0c;\u975e\u96f6\u503c\u8f6c\u4e3atrue&#xff1a;<\/span><\/p>\n<p>_Bool b &#061; 10;  \/\/ b\u7684\u503c\u4e3a1&#xff08;true&#xff09;<br \/>\nb &#061; 0.0;       \/\/ b\u7684\u503c\u4e3a0&#xff08;false&#xff09;<\/p>\n<h6><span style=\"color:#0d0016\">1.5\u3001\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u957f\u5ea6<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6bcf\u4e00\u79cd\u6570\u636e\u7c7b\u578b\u90fd\u6709\u81ea\u5df1\u7684\u957f\u5ea6&#xff0c;\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u80fd\u591f\u521b\u5efa\u51fa\u957f\u5ea6\u4e0d\u540c\u7684\u53d8\u91cf&#xff0c;\u53d8\u91cf\u957f\u5ea6\u7684\u4e0d \u540c&#xff0c;\u5b58\u50a8\u7684\u6570\u636e\u8303\u56f4\u5c31\u6709\u6240\u5dee\u5f02<\/span><\/p>\n<p><span style=\"color:#0d0016\">1.5.1\u3001sizeof\u64cd\u4f5c\u7b26<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sizeof \u662f\u2f00\u4e2a\u5173\u952e\u5b57&#xff0c;\u4e5f\u662f\u64cd\u4f5c\u7b26&#xff0c;\u4e13\u95e8\u662f\u7528\u6765\u8ba1\u7b97sizeof\u64cd\u4f5c\u7b26\u6570\u7684\u7c7b\u578b\u957f\u5ea6\u7684&#xff0c;\u5355\u4f4d\u662f\u5b57\u8282\u3002 sizeof \u64cd\u4f5c\u7b26\u7684\u64cd\u4f5c\u6570\u53ef\u4ee5\u662f\u7c7b\u578b&#xff0c;\u4e5f\u53ef\u662f\u53d8\u91cf\u6216\u8005\u8868\u8fbe\u5f0f\u3002\u5b83\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u6c42\u503c&#xff0c;\u8fd4\u56de\u4e00\u4e2a\u00a0size_t\u00a0\u7c7b\u578b\u7684\u65e0\u7b26\u53f7\u6574\u6570\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53ef\u4ee5\u76f4\u63a5\u5bf9\u6570\u636e\u7c7b\u578b\u4f7f\u7528\u00a0sizeof&#xff0c;\u4f8b\u5982&#xff1a;<\/span><\/p>\n<p>size_t int_size &#061; sizeof(int);  \/\/ \u8fd4\u56de int \u7c7b\u578b\u7684\u5927\u5c0f<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53ef\u4ee5\u5bf9\u53d8\u91cf\u4f7f\u7528\u00a0sizeof&#xff0c;\u65e0\u9700\u62ec\u53f7&#xff08;\u9664\u975e\u662f\u7c7b\u578b\u540d&#xff09;&#xff1a;<\/span><\/p>\n<p>int x;<br \/>\nsize_t x_size &#061; sizeof x;  \/\/ \u8fd4\u56de\u53d8\u91cf x \u7684\u5927\u5c0f<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5bf9\u6570\u7ec4\u4f7f\u7528\u00a0sizeof\u00a0\u4f1a\u8fd4\u56de\u6574\u4e2a\u6570\u7ec4\u7684\u5b57\u8282\u5927\u5c0f&#xff1a;<\/span><\/p>\n<p>int arr[10];<br \/>\nsize_t arr_size &#061; sizeof(arr);  \/\/ \u8fd4\u56de 10 * sizeof(int)<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5bf9\u6307\u9488\u4f7f\u7528\u00a0sizeof\u00a0\u8fd4\u56de\u6307\u9488\u672c\u8eab\u7684\u5927\u5c0f&#xff08;\u901a\u5e38\u4e3a 4 \u6216 8 \u5b57\u8282&#xff0c;\u53d6\u51b3\u4e8e\u7cfb\u7edf&#xff09;&#xff1a;<\/span><\/p>\n<p>int *ptr;<br \/>\nsize_t ptr_size &#061; sizeof(ptr);  \/\/ \u8fd4\u56de\u6307\u9488\u7684\u5927\u5c0f&#xff0c;\u800c\u975e\u6307\u5411\u7684\u6570\u636e\u5927\u5c0f<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sizeof\u4e2d\u8868\u8fbe\u5f0f\u4e0d\u8ba1\u7b97<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\nshort s &#061; 2;<br \/>\nint b &#061; 10;<br \/>\nprintf(&#034;%d\\\\n&#034;, sizeof(b &#061; b &#043; 1));<br \/>\n\/\/\u8868\u8fbe\u5f0fb &#061; b &#043; 1\u7684\u7c7b\u578b\u4e3aint&#xff08;\u56e0b\u662fint\u7c7b\u578b&#xff09;&#xff0c;\u6240\u4ee5sizeof\u8fd4\u56deint\u7684\u5b57\u8282\u6570&#xff08;\u901a\u5e38\u4e3a4&#xff09;<br \/>\nprintf(&#034;s &#061; %d\\\\n&#034;, s);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">2. signed \u548cunsigned<\/span><\/h4>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0C\u8bed\u8a00\u4f7f\u7528signed \u548c unsigned \u5173\u952e\u5b57\u4fee\u9970\u5b57\u7b26\u578b\u548c\u6574\u578b\u7c7b\u578b\u7684\u3002signed \u5173\u952e\u5b57&#xff0c;\u8868\u793a\u2f00\u4e2a\u7c7b\u578b\u5e26\u6709\u6b63\u8d1f\u53f7&#xff0c;\u5305\u542b\u8d1f\u503c&#xff1b; unsigned \u5173\u952e\u5b57&#xff0c;\u8868\u793a\u8be5\u7c7b\u578b\u4e0d\u5e26\u6709\u6b63\u8d1f\u53f7&#xff0c;\u53ea\u80fd\u8868\u793a\u96f6\u548c\u6b63\u6574\u6570\u3002 \u5bf9\u4e8e int \u7c7b\u578b&#xff0c;\u9ed8\u8ba4\u662f\u5e26\u6709\u6b63\u8d1f\u53f7\u7684&#xff0c;\u4e5f\u5c31\u662f\u8bf4\u7531\u4e8e\u8fd9\u662f\u9ed8\u8ba4\u60c5\u51b5&#xff0c;\u5173\u952e\u5b57 int \u7b49\u540c\u4e8e signed int \u3002 signed \u2f00\u822c\u90fd\u7701\u7565\u4e0d\u5199&#xff0c;\u4f46\u662f\u5199\u4e86\u4e5f\u4e0d\u7b97\u9519\u3002<\/span><\/p>\n<p>signed int a;<br \/>\n\/\/\u7b49\u540c\u4e8eint a; <\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53ef\u4ee5\u5c06 int \u7c7b\u578b\u58f0\u660e\u4e3a\u65e0\u7b26\u53f7\u5f62\u5f0f&#xff0c;\u4ec5\u8868\u793a\u975e\u8d1f\u6574\u6570&#xff0c;\u6b64\u65f6\u9700\u4f7f\u7528 unsigned \u5173\u952e\u5b57\u3002\u4f7f\u7528 unsigned \u58f0\u660e\u6574\u578b\u53d8\u91cf\u7684\u4f18\u52bf\u5728\u4e8e&#xff1a;\u76f8\u540c\u5185\u5b58\u7a7a\u95f4\u4e0b&#xff0c;\u53ef\u8868\u793a\u7684\u6700\u5927\u6574\u6570\u503c\u5c06\u6269\u5927\u4e00\u500d\u3002<\/span><\/p>\n<\/p>\n<p>unsigned int a; <\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0unsigned int\u91cc\u9762\u7684int\u53ef\u4ee5\u7701\u7565&#xff0c;\u5199\u6210\u4e0b\u9762\u8fd9\u6837&#xff1a;<\/span><\/p>\n<p>unsigned a<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5b57\u7b26\u7c7b\u578b char \u4e5f\u53ef\u4ee5\u8bbe\u7f6e signed \u548c unsigned \u3002<\/span><\/p>\n<p>signed char c;<br \/>\n\/\/\u8303\u56f4\u4e3a-128 \u5230127<br \/>\nunsigned char c;<br \/>\n\/\/ \u8303\u56f4\u4e3a0\u5230255 <\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;C\u8bed\u8a00\u89c4\u5b9achar\u7c7b\u578b\u9ed8\u8ba4\u662f\u5426\u5e26\u7b26\u53f7\u53d6\u51b3\u4e8e\u5f53\u524d\u7cfb\u7edf\u3002\u8fd9\u610f\u5473\u7740char\u5e76\u4e0d\u7b49\u540c\u4e8eunsigned char\u3002\u8fd9\u4e00\u70b9\u4e0eint\u4e0d\u540c&#xff0c;int\u9ed8\u8ba4\u7b49\u540c\u4e8esigned int\u3002<\/span><\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">3. \u6570\u636e\u7c7b\u578b\u7684\u53d6\u503c\u8303\u56f4<\/span><\/h4>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0C\u8bed\u8a00\u4e2d\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u53ca\u5176\u53d6\u503c\u8303\u56f4\u4e3b\u8981\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668\u548c\u7cfb\u7edf\u67b6\u6784&#xff08;\u598232\u4f4d\u621664\u4f4d&#xff09;\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u6570\u636e\u7c7b\u578b\u7684\u5178\u578b\u53d6\u503c\u8303\u56f4&#xff1a;<\/span><\/p>\n<h6><span style=\"color:#0d0016\">3.1\u3001\u6574\u578b<\/span><\/h6>\n<li>\n<p><span style=\"color:#0d0016\">char<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;1\u5b57\u8282&#xff08;8\u4f4d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6709\u7b26\u53f7&#xff1a;-128 \u5230 127<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7&#xff1a;0 \u5230 255<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">short<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;2\u5b57\u8282&#xff08;16\u4f4d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6709\u7b26\u53f7&#xff1a;-32,768 \u5230 32,767<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7&#xff1a;0 \u5230 65,535<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">int<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;\u901a\u5e384\u5b57\u8282&#xff08;32\u4f4d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6709\u7b26\u53f7&#xff1a;-2,147,483,648 \u5230 2,147,483,647<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7&#xff1a;0 \u5230 4,294,967,295<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">long<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;4\u5b57\u8282&#xff08;32\u4f4d\u7cfb\u7edf&#xff09;\u62168\u5b57\u8282&#xff08;64\u4f4d\u7cfb\u7edf&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">32\u4f4d\u6709\u7b26\u53f7&#xff1a;-2,147,483,648 \u5230 2,147,483,647<\/span><\/li>\n<li><span style=\"color:#0d0016\">64\u4f4d\u6709\u7b26\u53f7&#xff1a;-9,223,372,036,854,775,808 \u5230 9,223,372,036,854,775,807<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7&#xff1a;0 \u5230 18,446,744,073,709,551,615&#xff08;64\u4f4d&#xff09;<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">long long<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;8\u5b57\u8282&#xff08;64\u4f4d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6709\u7b26\u53f7&#xff1a;-9,223,372,036,854,775,808 \u5230 9,223,372,036,854,775,807<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7&#xff1a;0 \u5230 18,446,744,073,709,551,615<\/span><\/li>\n<\/ul>\n<\/li>\n<h6><span style=\"color:#0d0016\">3.2\u3001\u6d6e\u70b9\u578b<\/span><\/h6>\n<li>\n<p><span style=\"color:#0d0016\">float<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;4\u5b57\u8282&#xff08;32\u4f4d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u8303\u56f4&#xff1a;\u7ea6 1.2E-38 \u5230 3.4E&#043;38<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u7cbe\u5ea6&#xff1a;6-7\u4f4d\u5c0f\u6570<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">double<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;8\u5b57\u8282&#xff08;64\u4f4d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u8303\u56f4&#xff1a;\u7ea6 2.3E-308 \u5230 1.7E&#043;308<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u7cbe\u5ea6&#xff1a;15-16\u4f4d\u5c0f\u6570<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">long double<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u5927\u5c0f&#xff1a;\u901a\u5e3810\u5b57\u8282&#xff08;80\u4f4d&#xff09;\u6216\u66f4\u9ad8<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u8303\u56f4&#xff1a;\u66f4\u5927&#xff0c;\u5177\u4f53\u53d6\u51b3\u4e8e\u5b9e\u73b0<\/span><\/li>\n<\/ul>\n<\/li>\n<h6><span style=\"color:#0d0016\">3.3\u3001\u83b7\u53d6\u5177\u4f53\u503c\u7684\u4ee3\u7801\u793a\u4f8b<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53ef\u4ee5\u4f7f\u7528 &lt;limits.h&gt; \u548c &lt;float.h&gt; \u5934\u6587\u4ef6\u83b7\u53d6\u5177\u4f53\u7f16\u8bd1\u73af\u5883\u4e0b\u7684\u53d6\u503c\u8303\u56f4&#xff1a;<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;limits.h&gt;<br \/>\n#include &lt;float.h&gt;<\/p>\n<p>int main() {<br \/>\n    printf(&#034;char range: %d to %d\\\\n&#034;, CHAR_MIN, CHAR_MAX);<br \/>\n    printf(&#034;int range: %d to %d\\\\n&#034;, INT_MIN, INT_MAX);<br \/>\n    printf(&#034;float range: %e to %e\\\\n&#034;, FLT_MIN, FLT_MAX);<br \/>\n    return 0;<br \/>\n}<\/p>\n<h6><span style=\"color:#0d0016\">3.4\u3001\u6ce8\u610f\u4e8b\u9879<\/span><\/h6>\n<ul>\n<li><span style=\"color:#0d0016\">\u5b9e\u9645\u53d6\u503c\u8303\u56f4\u53ef\u80fd\u56e0\u7f16\u8bd1\u5668\u6216\u5e73\u53f0\u4e0d\u540c\u800c\u53d8\u5316&#xff0c;\u5efa\u8bae\u4f7f\u7528\u6807\u51c6\u5e93\u5b8f&#xff08;\u5982 INT_MAX&#xff09;\u83b7\u53d6\u5177\u4f53\u503c\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u65e0\u7b26\u53f7\u7c7b\u578b\u7684\u6700\u5c0f\u503c\u59cb\u7ec8\u4e3a 0&#xff0c;\u6700\u5927\u503c\u53ef\u901a\u8fc7 UINT_MAX \u7b49\u5b8f\u83b7\u53d6\u3002<\/span><\/li>\n<\/ul>\n<h4><span style=\"color:#0d0016\">4. \u53d8\u91cf<\/span><\/h4>\n<h6><span style=\"color:#0d0016\">4.1\u3001\u53d8\u91cf\u7684\u521b\u5efa<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e86\u89e3\u6e05\u695a\u4e86\u7c7b\u578b&#xff0c;\u6211\u4eec\u4f7f\u7528\u7c7b\u578b\u505a\u4ec0\u4e48\u5462&#xff1f;\u7c7b\u578b\u662f\u7528\u6765\u521b\u5efa\u53d8\u91cf\u7684\u3002\u4ec0\u4e48\u662f\u53d8\u91cf\u5462&#xff1f;C\u8bed\u8a00\u4e2d\u628a\u7ecf\u5e38\u53d8\u5316\u7684\u503c\u79f0\u4e3a\u53d8\u91cf&#xff0c;\u4e0d\u53d8\u7684\u503c\u79f0\u4e3a\u5e38\u91cf\u3002<\/span><\/p>\n<p>data_type name;<br \/>\n  |         |<br \/>\n  |         |<br \/>\n\u6570\u636e\u7c7b\u578b  \u53d8\u91cf\u540d<\/p>\n<p>int age; \/\/\u6574\u578b\u53d8\u91cf<br \/>\nchar ch; \/\/\u5b57\u7b26\u53d8\u91cf<br \/>\ndouble weight; \/\/\u6d6e\u70b9\u578b\u53d8\u91cf<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53d8\u91cf\u5728\u521b\u5efa\u7684\u65f6\u5019\u5c31\u7ed9\u2f00\u4e2a\u521d\u59cb\u503c&#xff0c;\u5c31\u53eb\u521d\u59cb\u5316\u3002<\/span><\/p>\n<p>int age &#061; 18;<br \/>\nchar ch &#061; &#039;w&#039;;<br \/>\ndouble weight &#061; 48.0;<br \/>\nunsigned int height &#061; 100;<\/p>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">4.2\u3001\u53d8\u91cf\u7684\u5206\u7c7b<\/span><\/h6>\n<ul>\n<li>\n<p><span style=\"color:#0d0016\">\u5168\u5c40\u53d8\u91cf&#xff1a;\u5b9a\u4e49\u5728\u5927\u62ec\u53f7\u5916\u7684\u53d8\u91cf\u79f0\u4e3a\u5168\u5c40\u53d8\u91cf\u3002\u5176\u4f5c\u7528\u57df\u8986\u76d6\u6574\u4e2a\u5de5\u7a0b&#xff0c;\u53ef\u4ee5\u5728\u4efb\u4f55\u5730\u65b9\u8c03\u7528\u4f7f\u7528\u3002<\/span><\/p>\n<\/li>\n<li><span style=\"color:#0d0016\">\u5c40\u90e8\u53d8\u91cf&#xff1a;\u5b9a\u4e49\u5728\u5927\u62ec\u53f7\u5185\u7684\u53d8\u91cf\u79f0\u4e3a\u5c40\u90e8\u53d8\u91cf\u3002\u5176\u4f5c\u7528\u8303\u56f4\u4ec5\u9650\u4e8e\u5b9a\u4e49\u5b83\u7684\u4ee3\u7801\u5757\u5185\u90e8&#xff0c;\u65e0\u6cd5\u5728\u5916\u90e8\u4f7f\u7528\u3002<\/span><\/li>\n<\/ul>\n<p>#include &lt;stdio.h&gt;<\/p>\n<p>int global &#061; 2023;\/\/\u5168\u5c40\u53d8\u91cf<br \/>\nint main()<br \/>\n {<br \/>\n    int local &#061; 2018;\/\/\u5c40\u90e8\u53d8\u91cf<br \/>\n    printf(&#034;%d\\\\n&#034;, local);<br \/>\n    printf(&#034;%d\\\\n&#034;, global);<br \/>\n    return 0;<br \/>\n }<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint n &#061; 1000;<br \/>\nint main()<br \/>\n{<br \/>\n   int n &#061; 10;<br \/>\n   printf(&#034;%d\\\\n&#034; n);\/\/\u6253\u5370\u7684\u7ed3\u679c\u662f\u591a\u5c11\u5462&#xff1f;<br \/>\n   return 0;<br \/>\n}<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5982\u679c\u5c40\u90e8\u548c\u5168\u5c40\u53d8\u91cf\u540c\u540d\u7684\u65f6\u5019&#xff0c;\u5c40\u90e8\u53d8\u91cf\u4f18\u5148\u4f7f\u7528\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728C\/C&#043;&#043;\u8bed\u8a00\u4e2d&#xff0c;\u53d8\u91cf\u6839\u636e\u4f5c\u7528\u57df\u4e0d\u540c\u5b58\u50a8\u4e8e\u5185\u5b58\u7684\u4e0d\u540c\u533a\u57df&#xff1a;<\/span><\/p>\n<li><span style=\"color:#0d0016\">\u5c40\u90e8\u53d8\u91cf&#xff1a;\u5b58\u50a8\u5728\u6808\u533a&#xff0c;\u51fd\u6570\u8c03\u7528\u65f6\u81ea\u52a8\u5206\u914d&#xff0c;\u51fd\u6570\u8fd4\u56de\u65f6\u81ea\u52a8\u91ca\u653e<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u5168\u5c40\u53d8\u91cf&#xff1a;\u5b58\u50a8\u5728\u9759\u6001\u533a&#xff0c;\u7a0b\u5e8f\u8fd0\u884c\u671f\u95f4\u59cb\u7ec8\u5b58\u5728<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u52a8\u6001\u5206\u914d\u5185\u5b58&#xff1a;\u4f7f\u7528\u5806\u533a\u8fdb\u884c\u7ba1\u7406&#xff0c;\u901a\u8fc7malloc\/new\u7533\u8bf7&#xff0c;free\/delete\u91ca\u653e<\/span><\/li>\n<\/p>\n<p><span style=\"color:#0d0016\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"878\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815132959-689f3657ba0b2.png\" width=\"959\" \/><\/span><\/p>\n<h4><span style=\"color:#0d0016\">5. \u7b97\u672f\u64cd\u4f5c\u7b26&#xff1a;&#043;\u3001-\u3001*\u3001\/\u3001%<\/span><\/h4>\n<h6><span style=\"color:#0d0016\">5.1\u3001\u7b97\u672f\u64cd\u4f5c\u7b26\u6982\u8ff0<\/span><\/h6>\n<p><span style=\"color:#0d0016\">C\u8bed\u8a00\u63d0\u4f9b\u4e94\u79cd\u57fa\u672c\u7b97\u672f\u64cd\u4f5c\u7b26&#xff0c;\u7528\u4e8e\u6267\u884c\u6570\u503c\u8ba1\u7b97&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">&#043;&#xff1a;\u52a0\u6cd5<\/span><\/li>\n<li><span style=\"color:#0d0016\">-&#xff1a;\u51cf\u6cd5<\/span><\/li>\n<li><span style=\"color:#0d0016\">*&#xff1a;\u4e58\u6cd5<\/span><\/li>\n<li><span style=\"color:#0d0016\">\/&#xff1a;\u9664\u6cd5<\/span><\/li>\n<li><span style=\"color:#0d0016\">%&#xff1a;\u53d6\u6a21&#xff08;\u6c42\u4f59\u6570&#xff09;<\/span><\/li>\n<\/ul>\n<h6><span style=\"color:#0d0016\">5.2\u3001\u52a0\u6cd5\u64cd\u4f5c\u7b26 &#043;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7528\u4e8e\u8ba1\u7b97\u4e24\u4e2a\u64cd\u4f5c\u6570\u7684\u548c\u3002<\/span><\/p>\n<p>int result &#061; 5 &#043; 3; \/\/ result &#061; 8<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u652f\u6301\u6574\u6570\u548c\u6d6e\u70b9\u6570\u8fd0\u7b97&#xff0c;\u7ed3\u679c\u4e3a\u64cd\u4f5c\u6570\u7c7b\u578b\u3002<\/span><\/p>\n<h6><span style=\"color:#0d0016\">5.3\u3001\u51cf\u6cd5\u64cd\u4f5c\u7b26 &#8211;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7528\u4e8e\u8ba1\u7b97\u4e24\u4e2a\u64cd\u4f5c\u6570\u7684\u5dee&#xff0c;\u6216\u8868\u793a\u8d1f\u6570\u3002<\/span><\/p>\n<p>int diff &#061; 10 &#8211; 4;  \/\/ diff &#061; 6<br \/>\nint neg &#061; -5;       \/\/ neg &#061; -5<\/p>\n<h6><span style=\"color:#0d0016\">5.4\u3001\u4e58\u6cd5\u64cd\u4f5c\u7b26 *<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7528\u4e8e\u8ba1\u7b97\u4e24\u4e2a\u64cd\u4f5c\u6570\u7684\u4e58\u79ef\u3002<\/span><\/p>\n<p>int product &#061; 6 * 7; \/\/ product &#061; 42<\/p>\n<h6><span style=\"color:#0d0016\">5.5\u3001\u9664\u6cd5\u64cd\u4f5c\u7b26 \/<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u6267\u884c\u9664\u6cd5\u8fd0\u7b97&#xff0c;\u7ed3\u679c\u53d6\u51b3\u4e8e\u64cd\u4f5c\u6570\u7c7b\u578b&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u6574\u6570\u9664\u6cd5&#xff1a;\u622a\u65ad\u5c0f\u6570\u90e8\u5206&#xff08;\u5411\u96f6\u53d6\u6574&#xff09;\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6d6e\u70b9\u6570\u9664\u6cd5&#xff1a;\u4fdd\u7559\u5c0f\u6570\u90e8\u5206\u3002<\/span><\/li>\n<\/ul>\n<p>int div_int &#061; 10 \/ 3;   \/\/ div_int &#061; 3<br \/>\nfloat div_float &#061; 10.0 \/ 3.0; \/\/ div_float \u2248 3.333&#8230;<\/p>\n<h6><span style=\"color:#0d0016\">5.6\u3001\u53d6\u6a21\u64cd\u4f5c\u7b26 %<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd4\u56de\u6574\u6570\u9664\u6cd5\u7684\u4f59\u6570&#xff0c;\u4ec5\u9002\u7528\u4e8e\u6574\u6570\u7c7b\u578b\u3002<\/span><\/p>\n<p>int remainder &#061; 10 % 3; \/\/ remainder &#061; 1<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u82e5\u64cd\u4f5c\u6570\u4e3a\u8d1f\u6570&#xff0c;\u7ed3\u679c\u7b26\u53f7\u4f9d\u8d56\u7f16\u8bd1\u5668\u5b9e\u73b0&#xff08;\u901a\u5e38\u4e0e\u88ab\u9664\u6570\u4e00\u81f4&#xff09;\u3002<\/span><\/p>\n<h6><span style=\"color:#0d0016\">5.7\u3001\u4f18\u5148\u7ea7\u4e0e\u7ed3\u5408\u6027<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u7b97\u672f\u64cd\u4f5c\u7b26\u7684\u4f18\u5148\u7ea7\u4ece\u9ad8\u5230\u4f4e&#xff1a;<\/span><\/p>\n<li><span style=\"color:#0d0016\">*\u3001\/\u3001%&#xff08;\u540c\u7ea7&#xff0c;\u5de6\u7ed3\u5408&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">&#043;\u3001-&#xff08;\u540c\u7ea7&#xff0c;\u5de6\u7ed3\u5408&#xff09;<\/span><\/li>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4f7f\u7528\u62ec\u53f7\u53ef\u663e\u5f0f\u63a7\u5236\u8fd0\u7b97\u987a\u5e8f&#xff1a;<\/span><\/p>\n<p>int value &#061; (2 &#043; 3) * 4; \/\/ value &#061; 20<\/p>\n<h6><span style=\"color:#0d0016\">5.8\u3001\u6ce8\u610f\u4e8b\u9879<\/span><\/h6>\n<ul>\n<li><span style=\"color:#0d0016\">\u6574\u6570\u9664\u4ee5\u96f6\u5bfc\u81f4\u8fd0\u884c\u65f6\u9519\u8bef\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u6d6e\u70b9\u6570\u9664\u4ee5\u96f6\u53ef\u80fd\u8fd4\u56de INF&#xff08;\u65e0\u7a77\u5927&#xff09;\u6216 NaN&#xff08;\u975e\u6570\u5b57&#xff09;\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u53d6\u6a21\u64cd\u4f5c\u7b26\u4e0d\u53ef\u7528\u4e8e\u6d6e\u70b9\u6570\u3002<\/span><\/li>\n<\/ul>\n<h4 style=\"background-color:transparent\"><span style=\"color:#0d0016\">6. \u8d4b\u503c\u64cd\u4f5c\u7b26&#xff1a;&#061;\u548c\u590d\u5408\u8d4b\u503c<\/span><\/h4>\n<h6><span style=\"color:#0d0016\">6.1\u3001\u57fa\u7840\u8d4b\u503c\u64cd\u4f5c\u7b26&#xff08;&#061;&#xff09;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728 C \u8bed\u8a00\u4e2d&#xff0c;&#061; \u662f\u57fa\u7840\u7684\u8d4b\u503c\u64cd\u4f5c\u7b26&#xff0c;\u7528\u4e8e\u5c06\u53f3\u4fa7\u8868\u8fbe\u5f0f\u7684\u503c\u8d4b\u7ed9\u5de6\u4fa7\u7684\u53d8\u91cf\u3002\u8bed\u6cd5\u5f62\u5f0f\u4e3a&#xff1a;<\/span><\/p>\n<p>variable &#061; expression;<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8d4b\u503c\u64cd\u4f5c\u7b26\u7684\u4f18\u5148\u7ea7\u8f83\u4f4e&#xff0c;\u901a\u5e38\u7ed3\u5408\u65b9\u5411\u4e3a\u4ece\u53f3\u5411\u5de6\u3002\u4f8b\u5982&#xff1a;<\/span><\/p>\n<p>int a, b;<br \/>\na &#061; 5;     \/\/ \u5c06 5 \u8d4b\u7ed9\u53d8\u91cf a<br \/>\nb &#061; a &#043; 3; \/\/ \u8ba1\u7b97 a &#043; 3 \u5e76\u5c06\u7ed3\u679c\u8d4b\u7ed9 b<\/p>\n<h6><span style=\"color:#0d0016\">6.2\u3001\u590d\u5408\u8d4b\u503c\u64cd\u4f5c\u7b26<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u590d\u5408\u8d4b\u503c\u64cd\u4f5c\u7b26\u7ed3\u5408\u4e86\u8d4b\u503c\u4e0e\u7b97\u672f\/\u4f4d\u8fd0\u7b97&#xff0c;\u7b80\u5316\u4ee3\u7801\u5e76\u63d0\u5347\u53ef\u8bfb\u6027\u3002\u5e38\u89c1\u5f62\u5f0f\u5305\u62ec&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">&#043;&#061;&#xff08;\u52a0\u6cd5\u8d4b\u503c&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">-&#061;&#xff08;\u51cf\u6cd5\u8d4b\u503c&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">*&#061;&#xff08;\u4e58\u6cd5\u8d4b\u503c&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\/&#061;&#xff08;\u9664\u6cd5\u8d4b\u503c&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%&#061;&#xff08;\u53d6\u6a21\u8d4b\u503c&#xff09;<\/span><\/li>\n<\/ul>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8bed\u6cd5\u5f62\u5f0f\u4e3a&#xff1a;<\/span><\/p>\n<p>variable op&#061; expression;<br \/>\n\/\/ \u7b49\u4ef7\u4e8e variable &#061; variable op (expression)<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u793a\u4f8b&#xff1a;<\/span><\/p>\n<p>int x &#061; 10;<br \/>\nx &#043;&#061; 5;    \/\/ x &#061; x &#043; 5 \u2192 15<br \/>\nx *&#061; 2;    \/\/ x &#061; x * 2 \u2192 30<\/p>\n<h6><span style=\"color:#0d0016\">6.3\u3001\u6ce8\u610f\u4e8b\u9879<\/span><\/h6>\n<ul>\n<li><span style=\"color:#0d0016\">\u53f3\u7ed3\u5408\u6027&#xff1a;\u590d\u5408\u8d4b\u503c\u64cd\u4f5c\u7b26\u4ece\u53f3\u5411\u5de6\u8ba1\u7b97\u3002\u4f8b\u5982 a &#043;&#061; b *&#061; 2 \u7b49\u4ef7\u4e8e a &#043;&#061; (b *&#061; 2)\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u8868\u8fbe\u5f0f\u6c42\u503c\u987a\u5e8f&#xff1a;\u53f3\u4fa7\u8868\u8fbe\u5f0f\u4f1a\u5148\u8ba1\u7b97&#xff0c;\u518d\u4e0e\u5de6\u4fa7\u53d8\u91cf\u8fd0\u7b97\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u7c7b\u578b\u5339\u914d&#xff1a;\u9700\u786e\u4fdd\u5de6\u53f3\u64cd\u4f5c\u6570\u7c7b\u578b\u517c\u5bb9&#xff0c;\u5426\u5219\u53ef\u80fd\u89e6\u53d1\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u6216\u8b66\u544a\u3002<\/span><\/li>\n<\/ul>\n<h4 style=\"background-color:transparent\"><span style=\"color:#0d0016\">7. \u5355\u76ee\u64cd\u4f5c\u7b26&#xff1a;&#043;&#043;\u3001&#8211;\u3001&#043;\u3001<\/span><\/h4>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">7.1\u3001\u81ea\u589e\u64cd\u4f5c\u7b26 &#043;&#043;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7528\u4e8e\u5c06\u64cd\u4f5c\u6570\u7684\u503c\u589e\u52a01&#xff0c;\u5206\u4e3a\u524d\u7f00&#xff08;&#043;&#043;a&#xff09;\u548c\u540e\u7f00&#xff08;a&#043;&#043;&#xff09;\u4e24\u79cd\u5f62\u5f0f\u3002<\/span><\/p>\n<ul>\n<li>\n<p><span style=\"color:#0d0016\">\u524d\u7f00\u5f62\u5f0f&#xff1a;\u5148\u81ea\u589e&#xff0c;\u518d\u4f7f\u7528\u53d8\u91cf\u7684\u503c\u3002\u8ba1\u7b97\u53e3\u8bc0&#xff1a;\u5148&#043;1&#xff0c;\u540e\u4f7f\u7528&#xff1b;<\/span><\/p>\n<p>int a &#061; 5;<br \/>\nint b &#061; &#043;&#043;a; \/\/ a\u5148\u53d8\u4e3a6&#xff0c;\u518d\u8d4b\u503c\u7ed9b<br \/>\nprintf(&#034;%d, %d&#034;, a, b); \/\/ \u8f93\u51fa: 6, 6<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u540e\u7f00\u5f62\u5f0f&#xff1a;\u5148\u4f7f\u7528\u53d8\u91cf\u7684\u503c&#xff0c;\u518d\u81ea\u589e\u3002\u8ba1\u7b97\u53e3\u8bc0&#xff1a;\u5148\u4f7f\u7528&#xff0c;\u540e&#043;1<\/span><\/p>\n<p>int a &#061; 5;<br \/>\nint b &#061; a&#043;&#043;; \/\/ b\u8d4b\u503c\u4e3a5&#xff0c;a\u968f\u540e\u53d8\u4e3a6<br \/>\nprintf(&#034;%d, %d&#034;, a, b); \/\/ \u8f93\u51fa: 6, 5<\/p>\n<\/li>\n<\/ul>\n<h6><span style=\"color:#0d0016\">7.2\u3001\u81ea\u51cf\u64cd\u4f5c\u7b26 &#8212;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7528\u4e8e\u5c06\u64cd\u4f5c\u6570\u7684\u503c\u51cf\u5c111&#xff0c;\u540c\u6837\u5206\u4e3a\u524d\u7f00&#xff08;&#8211;a&#xff09;\u548c\u540e\u7f00&#xff08;a&#8211;&#xff09;\u3002<\/span><\/p>\n<ul>\n<li>\n<p><span style=\"color:#0d0016\">\u524d\u7f00\u5f62\u5f0f&#xff1a;\u5148\u81ea\u51cf&#xff0c;\u518d\u4f7f\u7528\u53d8\u91cf\u3002\u8ba1\u7b97\u53e3\u8bc0&#xff1a;\u5148-1&#xff0c;\u540e\u4f7f\u7528\u3002<\/span><\/p>\n<p>int a &#061; 5;<br \/>\nint b &#061; &#8211;a; \/\/ a\u53d8\u4e3a4&#xff0c;b\u8d4b\u503c\u4e3a4<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u540e\u7f00\u5f62\u5f0f&#xff1a;\u5148\u4f7f\u7528\u53d8\u91cf&#xff0c;\u518d\u81ea\u51cf\u3002\u8ba1\u7b97\u53e3\u8bc0&#xff1a;\u5148\u4f7f\u7528&#xff0c;\u540e-1<\/span><\/p>\n<p>int a &#061; 5;<br \/>\nint b &#061; a&#8211;; \/\/ b\u8d4b\u503c\u4e3a5&#xff0c;a\u53d8\u4e3a4<\/p>\n<\/li>\n<\/ul>\n<h6><span style=\"color:#0d0016\">7.3\u3001\u6b63\u53f7\u64cd\u4f5c\u7b26 &#043;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8868\u793a\u6570\u503c\u7684\u6b63\u503c&#xff08;\u901a\u5e38\u7701\u7565&#xff09;&#xff0c;\u4f46\u53ef\u7528\u4e8e\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u6216\u660e\u786e\u8868\u8fbe\u5f0f\u8bed\u4e49\u3002<\/span><\/p>\n<p>int a &#061; -10;<br \/>\nint b &#061; &#043;a; \/\/ b\u4e3a-10&#xff08;\u65e0\u5b9e\u9645\u53d8\u5316&#xff09;<\/p>\n<h6><span style=\"color:#0d0016\">7.4\u3001\u8d1f\u53f7\u64cd\u4f5c\u7b26 &#8211;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5bf9\u64cd\u4f5c\u6570\u53d6\u8d1f\u503c\u3002<\/span><\/p>\n<p>int a &#061; 10;<br \/>\nint b &#061; -a; \/\/ b\u4e3a-10<\/p>\n<h6><span style=\"color:#0d0016\">7.5\u3001\u6ce8\u610f\u4e8b\u9879<\/span><\/h6>\n<li>\n<p><span style=\"color:#0d0016\">\u526f\u4f5c\u7528&#xff1a;&#043;&#043;\u548c&#8211;\u4f1a\u4fee\u6539\u64cd\u4f5c\u6570\u7684\u503c&#xff0c;\u907f\u514d\u5728\u540c\u4e00\u4e2a\u8868\u8fbe\u5f0f\u4e2d\u591a\u6b21\u4f7f\u7528\u540c\u4e00\u53d8\u91cf\u7684\u81ea\u589e\/\u81ea\u51cf\u3002<\/span><\/p>\n<p>int a &#061; 5;<br \/>\nint b &#061; a&#043;&#043; &#043; a&#043;&#043;; \/\/ \u672a\u5b9a\u4e49\u884c\u4e3a<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u7c7b\u578b\u9650\u5236&#xff1a;&#043;&#043;\u548c&#8211;\u4ec5\u9002\u7528\u4e8e\u53d8\u91cf&#xff0c;\u4e0d\u80fd\u7528\u4e8e\u5e38\u91cf\u6216\u8868\u8fbe\u5f0f&#xff08;\u59825&#043;&#043;\u975e\u6cd5&#xff09;\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span style=\"color:#0d0016\">\u7ed3\u5408\u6027&#xff1a;\u5355\u76ee\u64cd\u4f5c\u7b26\u4ece\u53f3\u5411\u5de6\u7ed3\u5408\u3002\u4f8b\u5982&#xff0c;-&#043;-a\u7b49\u4ef7\u4e8e- (&#043; (-a))\u3002<\/span><\/p>\n<\/li>\n<h4><span style=\"color:#0d0016\">8. \u5f3a\u5236\u7c7b\u578b\u8f6c\u6362<\/span><\/h4>\n<p> int a &#061; 3.14;\/\/a\u7684\u662fint\u7c7b\u578b, 3.14\u662fdouble\u7c7b\u578b&#xff0c;\u4e24\u8fb9\u7684\u7c7b\u578b\u4e0d\u2f00\u81f4&#xff0c;\u7f16\u8bd1\u5668\u4f1a\u62a5\u8b66\u544a <\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3a\u4e86\u6d88\u9664\u8fd9\u4e2a\u8b66\u544a&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u2f64\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362&#xff1a;<\/span><\/p>\n<p> int a &#061; (int)3.14;\/\/\u610f\u601d\u662f\u5c063.14\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4e3aint\u7c7b\u578b&#xff0c;\u8fd9\u79cd\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u53ea\u53d6\u6574\u6570\u90e8\u5206<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6211\u4eec\u4f7f\u7528\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u90fd\u662f\u4e07\u4e0d\u5f97\u5df2\u7684\u65f6\u5019\u4f7f\u7528&#xff0c;\u5982\u679c\u4e0d\u9700\u8981\u5f3a\u5236\u7c7b\u578b\u8f6c\u5316 \u5c31\u80fd\u5b9e\u73b0\u4ee3\u7801&#xff0c;\u8fd9\u6837\u81ea\u7136\u66f4\u597d\u7684<\/span><\/p>\n<h4><span style=\"color:#0d0016\">9. scanf\u548cprintf\u4ecb\u7ecd<\/span><\/h4>\n<h6><span style=\"color:#0d0016\">9.1\u3001printf<\/span><\/h6>\n<h6><span style=\"color:#0d0016\">\u00a0 \u00a0 \u00a0 \u00a0 9.1.1\u3001\u57fa\u672c\u7528\u6cd5&#xff1a;<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf\u662fC\u8bed\u8a00\u6807\u51c6\u5e93\u4e2d\u7684\u8f93\u51fa\u51fd\u6570&#xff0c;\u7528\u4e8e\u5411\u6807\u51c6\u8f93\u51fa&#xff08;\u5982\u5c4f\u5e55&#xff09;\u6253\u5370\u683c\u5f0f\u5316\u6570\u636e\u3002\u5b83\u540d\u5b57\u91cc\u7684f\u4ee3\u8868format&#xff08;\u683c\u5f0f\u5316&#xff09;&#xff0c;\u8868\u793a\u53ef\u4ee5\u5b9a\u5236\u8f93\u51fa\u6587\u672c\u7684\u683c\u5f0f\u3002<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n int main()<br \/>\n{<br \/>\n   printf(&#034;Hello World&#034;);<br \/>\n   return 0;<br \/>\n }<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf() \u662f\u5728\u6807\u51c6\u5e93\u7684\u5934\u2f42\u4ef6 stdio.h \u5b9a\u4e49\u7684\u3002\u4f7f\u7528\u8fd9\u4e2a\u51fd\u6570\u4e4b\u524d&#xff0c;\u5fc5\u987b\u5728\u6e90\u7801\u6587\u4ef6\u5934\u90e8\u5f15\u5165\u8fd9 \u4e2a\u5934\u6587\u4ef6\u3002<\/span><\/p>\n<h6><span style=\"color:#0d0016\">\u00a0 \u00a0 \u00a0 \u00a0 9.1.2\u3001\u5360\u4f4d\u7b26<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6240\u8c13\u201c\u5360\u4f4d\u7b26\u201d&#xff0c;\u5c31\u662f\u8fd9\u4e2a\u4f4d\u7f6e\u53ef\u4ee5\u2f64\u5176\u4ed6\u503c\u4ee3\u5165\u3002\u00a0 \u00a0\u00a0<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n   printf(&#034;There are %d apples\\\\n&#034;, 3);<br \/>\n   return 0;<br \/>\n}<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d&#xff0c;&#034;There are %d apples\\\\n&#034;\u662f\u8f93\u51fa\u6587\u672c&#xff0c;\u5176\u4e2d\u7684%d\u4f5c\u4e3a\u5360\u4f4d\u7b26&#xff0c;\u8868\u793a\u8be5\u4f4d\u7f6e\u5c06\u88ab\u5176\u4ed6\u503c\u66ff\u6362\u3002\u5360\u4f4d\u7b26\u7684\u9996\u5b57\u7b26\u59cb\u7ec8\u4e3a\u767e\u5206\u53f7%&#xff0c;\u7b2c\u4e8c\u4e2a\u5b57\u7b26\u5219\u4ee3\u8868\u5360\u4f4d\u7b26\u7684\u7c7b\u578b\u3002\u4f8b\u5982%d\u8868\u793a\u6b64\u5904\u5fc5\u987b\u586b\u5165\u4e00\u4e2a\u6574\u6570\u503c\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5e38\u7528\u7684\u5360\u4f4d\u7b26\u9664\u4e86%d\u4e4b\u5916&#xff0c;\u8fd8\u6709%s\u7528\u4e8e\u8868\u793a\u5b57\u7b26\u4e32\u7684\u63d2\u5165\u3002<\/span><\/p>\n<p> #include &lt;stdio.h&gt;<br \/>\n int main()<br \/>\n {<br \/>\n   printf(&#034;%s will come tonight\\\\n&#034;, &#034;zhangsan&#034;);<br \/>\n   return 0<br \/>\n}<\/p>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">\u00a0 \u00a0 \u00a0 \u00a0 9.1.3\u3001\u5360\u4f4d\u7b26\u5217\u4e3e<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4ee5\u4e0b\u6309\u5b57\u6bcd\u987a\u5e8f\u5217\u51fa C \u8bed\u8a00\u4e2d\u5e38\u7528\u7684 printf() \u5360\u4f4d\u7b26&#xff0c;\u6bcf\u79cd\u5360\u4f4d\u7b26\u5bf9\u5e94\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">%a&#xff1a;\u5341\u516d\u8fdb\u5236\u6d6e\u70b9\u6570&#xff08;\u5b57\u6bcd\u5c0f\u5199&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%A&#xff1a;\u5341\u516d\u8fdb\u5236\u6d6e\u70b9\u6570&#xff08;\u5b57\u6bcd\u5927\u5199&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%c&#xff1a;\u5b57\u7b26<\/span><\/li>\n<li><span style=\"color:#0d0016\">%d&#xff1a;\u5341\u8fdb\u5236\u6574\u6570<\/span><\/li>\n<li><span style=\"color:#0d0016\">%e&#xff1a;\u79d1\u5b66\u8ba1\u6570\u6cd5\u6d6e\u70b9\u6570&#xff08;\u6307\u6570\u90e8\u5206\u5c0f\u5199 e&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%E&#xff1a;\u79d1\u5b66\u8ba1\u6570\u6cd5\u6d6e\u70b9\u6570&#xff08;\u6307\u6570\u90e8\u5206\u5927\u5199 E&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%f&#xff1a;\u5c0f\u6570&#xff08;\u5305\u542b float \u548c double \u7c7b\u578b&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%g&#xff1a;6 \u4f4d\u6709\u6548\u6570\u5b57\u6d6e\u70b9\u6570&#xff08;\u81ea\u52a8\u8f6c\u4e3a\u79d1\u5b66\u8ba1\u6570\u6cd5\u65f6\u6307\u6570\u90e8\u5206\u5c0f\u5199 e&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%G&#xff1a;\u540c %g&#xff08;\u6307\u6570\u90e8\u5206\u5927\u5199 E&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%hd&#xff1a;\u5341\u8fdb\u5236 short int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%ho&#xff1a;\u516b\u8fdb\u5236 short int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%hx&#xff1a;\u5341\u516d\u8fdb\u5236 short int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%hu&#xff1a;unsigned short int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%i&#xff1a;\u6574\u6570&#xff08;\u57fa\u672c\u7b49\u540c\u4e8e %d&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%ld&#xff1a;\u5341\u8fdb\u5236 long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%lo&#xff1a;\u516b\u8fdb\u5236 long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%lx&#xff1a;\u5341\u516d\u8fdb\u5236 long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%lu&#xff1a;unsigned long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%lld&#xff1a;\u5341\u8fdb\u5236 long long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%llo&#xff1a;\u516b\u8fdb\u5236 long long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%llx&#xff1a;\u5341\u516d\u8fdb\u5236 long long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%llu&#xff1a;unsigned long long int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%Le&#xff1a;\u79d1\u5b66\u8ba1\u6570\u6cd5\u8868\u793a\u7684 long double \u7c7b\u578b\u6d6e\u70b9\u6570<\/span><\/li>\n<li><span style=\"color:#0d0016\">%Lf&#xff1a;long double \u7c7b\u578b\u6d6e\u70b9\u6570<\/span><\/li>\n<li><span style=\"color:#0d0016\">%n&#xff1a;\u8bb0\u5f55\u5df2\u8f93\u51fa\u7684\u5b57\u7b26\u6570\u91cf&#xff08;\u4e0d\u663e\u793a&#xff0c;\u4ec5\u5b58\u50a8\u5230\u53d8\u91cf&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">%o&#xff1a;\u516b\u8fdb\u5236\u6574\u6570<\/span><\/li>\n<li><span style=\"color:#0d0016\">%p&#xff1a;\u6307\u9488<\/span><\/li>\n<li><span style=\"color:#0d0016\">%s&#xff1a;\u5b57\u7b26\u4e32<\/span><\/li>\n<li><span style=\"color:#0d0016\">%u&#xff1a;unsigned int \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%x&#xff1a;\u5341\u516d\u8fdb\u5236\u6574\u6570<\/span><\/li>\n<li><span style=\"color:#0d0016\">%zd&#xff1a;size_t \u7c7b\u578b<\/span><\/li>\n<li><span style=\"color:#0d0016\">%%&#xff1a;\u8f93\u51fa\u767e\u5206\u53f7&#xff08;%&#xff09;<\/span><\/li>\n<\/ul>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09.1.4\u3001\u9650\u5b9a\u5360\u4f4d\u7b26\u5bbd\u5ea6<\/span><\/h6>\n<p>int num &#061; 42;<br \/>\nprintf(&#034;%5d&#034;, num);   \/\/ \u8f93\u51fa &#034;   42&#034;&#xff08;\u53f3\u5bf9\u9f50&#xff0c;\u5bbd\u5ea65&#xff09;<br \/>\nprintf(&#034;%-5d&#034;, num);  \/\/ \u8f93\u51fa &#034;42   &#034;&#xff08;\u5de6\u5bf9\u9f50&#xff0c;\u5bbd\u5ea65&#xff09;<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d&#xff0c;%5d\u8868\u793a\u8be5\u5360\u4f4d\u7b26\u7684\u5bbd\u5ea6\u81f3\u5c11\u4e3a5\u4e2a\u5b57\u7b26\u3002\u5982\u679c\u6570\u503c\u4e0d\u8db35\u4f4d&#xff0c;\u7cfb\u7edf\u4f1a\u5728\u503c\u7684\u524d\u9762\u6dfb\u52a0\u7a7a\u683c\u8fdb\u884c\u586b\u5145\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u8f93\u51fa\u5185\u5bb9\u91c7\u7528\u53f3\u5bf9\u9f50\u65b9\u5f0f&#xff0c;\u56e0\u6b64\u4f1a\u5728\u6570\u5b57\u524d\u6dfb\u52a0\u7a7a\u683c&#xff1b;\u5982\u9700\u6539\u4e3a\u5de6\u5bf9\u9f50&#xff08;\u5728\u6570\u5b57\u540e\u6dfb\u52a0\u7a7a\u683c&#xff09;&#xff0c;\u53ea\u9700\u5728\u5360\u4f4d\u7b26\u7684%\u540e\u6dfb\u52a0-\u7b26\u53f7\u5373\u53ef\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5c0f\u6570\u90e8\u5206\u7684\u9650\u5b9a\u7b26\u7528\u4e8e\u63a7\u5236\u6240\u6709\u6570\u5b57\u7684\u6700\u5c0f\u663e\u793a\u5bbd\u5ea6\u3002<\/span><\/p>\n<p>\/\/ \u8f93\u51fa &#034;  123.450000&#034;<br \/>\n#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n   printf(&#034;%12f\\\\n&#034;, 123.45);<br \/>\n   return 0;<br \/>\n}<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d&#xff0c;%12f\u8868\u793a\u8f93\u51fa\u7684\u6d6e\u70b9\u6570\u81f3\u5c11\u5360\u636e12\u4f4d\u5bbd\u5ea6\u3002\u7531\u4e8e\u9ed8\u8ba4\u663e\u793a\u7cbe\u5ea6\u4e3a\u5c0f\u6570\u70b9\u540e6\u4f4d&#xff0c;\u56e0\u6b64\u8f93\u51fa23.45\u65f6&#xff0c;\u7ed3\u679c\u524d\u4f1a\u6dfb\u52a02\u4e2a\u7a7a\u683c\u3002<\/span><\/p>\n<h6><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09.1.5\u3001\u603b\u662f\u663e\u793a\u6b63\u8d1f\u53f7<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c; printf() \u4e0d\u5bf9\u6b63\u6570\u663e\u2f70 &#043; \u53f7&#xff0c;\u53ea\u5bf9\u8d1f\u6570\u663e\u793a\u53f7\u3002\u5982\u679c\u60f3\u8ba9\u6b63\u6570\u4e5f\u8f93\u51fa &#043; \u53f7&#xff0c;\u53ef \u4ee5\u5728\u5360\u4f4d\u7b26\u7684 % \u540e\u2faf\u52a0\u2f00\u4e2a &#043; \u3002<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    printf(&#034;%&#043;d\\\\n&#034;, 12);  \/\/ \u8f93\u51fa &#043;12<br \/>\n    printf(&#034;%&#043;d\\\\n&#034;, -12); \/\/ \u8f93\u51fa -12<br \/>\n    return 0;<br \/>\n}<\/p>\n<p><span style=\"color:#0d0016\">\u00a0 \u00a0 \u00a0 \u00a0 9.1.6\u3001\u9650\u5b9a\u5c0f\u6570\u4f4d\u6570<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5982\u9700\u63a7\u5236\u5c0f\u6570\u4f4d\u6570&#xff0c;\u53ef\u901a\u8fc7\u683c\u5f0f\u5316\u5360\u4f4d\u7b26\u5b9e\u73b0\u3002\u4f8b\u5982&#xff0c;\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\u53ef\u4f7f\u7528&#034;%.2f&#034;\u683c\u5f0f\u3002<\/span><\/p>\n<p>\/\/ \u8f93\u51faNumber is 0.50<br \/>\n#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n   printf(&#034;Number is %.2f\\\\n&#034;, 0.5);<br \/>\n   return 0;<br \/>\n}<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u79cd\u5199\u6cd5\u53ef\u4ee5\u4e0e\u9650\u5b9a\u5bbd\u5ea6\u5360\u4f4d\u7b26&#xff0c;\u7ed3\u5408\u4f7f\u7528\u3002<\/span><\/p>\n<p>\/\/ \u8f93\u51fa\u4e3a&#034;  0.50&#034;<br \/>\n#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n  printf(&#034;%6.2f\\\\n&#034;, 0.5);<br \/>\n  return 0;<br \/>\n}<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6700\u5c0f\u5bbd\u5ea6\u548c\u5c0f\u6570\u4f4d\u6570\u8fd9\u4e24\u4e2a\u53c2\u6570&#xff0c;\u90fd\u53ef\u4ee5\u4f7f\u7528*\u6765\u6307\u5b9a&#xff0c;\u5e76\u901a\u8fc7printf()\u51fd\u6570\u8fdb\u884c\u52a8\u6001\u4f20\u5165\u3002<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n  printf(&#034;%*.*f\\\\n&#034;, 6, 2, 0.5);<br \/>\n  return 0;<br \/>\n}<br \/>\n\/\/\u7b49\u540c\u4e8eprintf(&#034;%6.2f\\\\n&#034;, 0.5); <\/p>\n<h6><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09.1.6\u3001\u8f93\u51fa\u90e8\u5206\u5b57\u7b26\u4e32<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u00a0 \u00a0%s \u5360\u4f4d\u7b26\u7528\u4e8e\u8f93\u51fa\u5b57\u7b26\u4e32&#xff0c;\u9ed8\u8ba4\u4f1a\u663e\u793a\u5b8c\u6574\u5185\u5bb9\u3002\u82e5\u53ea\u9700\u663e\u793a\u5f00\u5934\u90e8\u5206&#xff0c;\u53ef\u4f7f\u7528%.[m]s\u683c\u5f0f&#xff0c;\u5176\u4e2d m \u4ee3\u8868\u8981\u663e\u793a\u7684\u5b57\u7b26\u6570\u3002<\/span><\/p>\n<p>\/\/ \u8f93\u51fahello<br \/>\n#include &lt;stdio.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n  printf(&#034;%.5s\\\\n&#034;, &#034;hello world&#034;);<br \/>\n  return 0;<br \/>\n}<\/p>\n<h6><span style=\"color:#0d0016\">9.2\u3001scanf<\/span><\/h6>\n<h6><span style=\"color:#0d0016\">9.2.1\u3001scanf \u57fa\u672c\u7528\u6cd5<\/span><\/h6>\n<p><span style=\"color:#0d0016\">scanf \u662f C \u8bed\u8a00\u4e2d\u7528\u4e8e\u4ece\u6807\u51c6\u8f93\u5165&#xff08;\u5982\u952e\u76d8&#xff09;\u8bfb\u53d6\u6570\u636e\u7684\u51fd\u6570&#xff0c;\u5176\u57fa\u672c\u8bed\u6cd5\u4e3a&#xff1a;<\/span><\/p>\n<p>scanf(&#034;%d&#034;, &amp;i);<\/p>\n<p><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5b83\u7684\u7b2c\u2f00\u4e2a\u53c2\u6570\u662f\u2f00\u4e2a\u683c\u5f0f\u5b57\u7b26\u4e32&#xff0c;\u91cc\u9762\u4f1a\u653e\u7f6e\u5360\u4f4d\u7b26&#xff08;\u4e0e\u7f16\u8bd1\u5668\u5982\u4f55\u89e3\u8bfb\u7528\u6237\u7684\u8f93\u5165&#xff0c;\u9700\u8981\u63d0\u53d6\u7684\u6570\u636e\u662f\u4ec0\u4e48\u7c7b\u578b\u3002 \u8fd9\u662f\u56e0\u4e3aC\u8bed\u8a00\u7684\u6570\u636e\u90fd\u662f\u6709\u7c7b\u578b\u7684&#xff0c;&#xff08;\u4e0eprintf() \u7684\u5360\u4f4d\u7b26\u57fa\u672c\u4e00\u81f4&#xff09;&#xff0c;scanf() \u5fc5\u987b\u63d0\u524d\u77e5\u9053\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u624d\u80fd\u5904\u7406\u6570\u636e\u3002 \u5b83\u7684\u5176\u4f59\u53c2\u6570\u5c31\u662f\u5b58\u653e\u7528\u6237\u8f93\u5165\u7684\u53d8\u91cf&#xff0c;\u683c\u5f0f\u5b57\u7b26\u4e32\u91cc\u9762\u6709\u591a\u5c11\u4e2a\u5360\u4f4d\u7b26&#xff0c;\u5c31\u6709\u591a\u5c11\u4e2a\u53d8\u91cf\u3002 \u4e0a\u9762\u793a\u4f8b\u4e2d&#xff0c; scanf() \u7684\u7b2c\u4e00\u4e2a\u53c2\u6570 %d &#xff0c;\u8868\u793a\u7528\u6237\u8f93\u5165\u7684\u5e94\u8be5\u662f\u4e00\u4e2a\u6574\u6570\u3002 %d \u5c31\u662f\u2f00\u4e2a\u5360\u4f4d \u7b26&#xff0c; % \u662f\u5360\u4f4d\u7b26\u7684\u6807\u5fd7&#xff0c; d \u8868\u793a\u6574\u6570\u3002\u7b2c\u2f06\u4e2a\u53c2\u6570 &amp;i \u8868\u793a&#xff0c;\u5c06\u7528\u6237\u4ece\u952e\u76d8\u8f93\u5165\u7684\u6574\u6570\u5b58\u5165\u53d8\u91cf i \u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u793a\u4f8b&#xff1a;<\/span><\/p>\n<p>int num;<br \/>\nscanf(&#034;%d&#034;, &amp;num); \/\/ \u8bfb\u53d6\u4e00\u4e2a\u6574\u6570\u5e76\u5b58\u5165 num<\/p>\n<hr \/>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">9.2.2\u3001scanf \u8fd4\u56de\u503c<\/span><\/h6>\n<p><span style=\"color:#0d0016\">scanf \u8fd4\u56de\u6210\u529f\u5339\u914d\u5e76\u8d4b\u503c\u7684\u8f93\u5165\u9879\u6570\u91cf\u3002\u82e5\u8f93\u5165\u4e0e\u683c\u5f0f\u4e0d\u5339\u914d\u6216\u9047\u5230\u6587\u4ef6\u7ed3\u675f\u7b26&#xff08;\u5982 Ctrl&#043;D\/Ctrl&#043;Z&#xff09;&#xff0c;\u8fd4\u56de EOF&#xff08;\u901a\u5e38\u4e3a -1&#xff09;\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u793a\u4f8b&#xff1a;<\/span><\/p>\n<p>int a, b;<br \/>\nint count &#061; scanf(&#034;%d %d&#034;, &amp;a, &amp;b);<br \/>\n\/\/ \u82e5\u8f93\u5165 &#034;10 20&#034;&#xff0c;count \u4e3a 2&#xff1b;\u82e5\u8f93\u5165 &#034;10 abc&#034;&#xff0c;count \u4e3a 1\u3002<\/p>\n<hr \/>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">9.2.3\u3001\u5e38\u7528\u5360\u4f4d\u7b26<\/span><\/h6>\n<p><span style=\"color:#0d0016\">scanf \u7684\u5360\u4f4d\u7b26\u9700\u4e0e\u53d8\u91cf\u7c7b\u578b\u4e25\u683c\u5339\u914d&#xff1a;<\/span><\/p>\n<table>\n<tr><span style=\"color:#0d0016\">\u5360\u4f4d\u7b26<\/span><span style=\"color:#0d0016\">\u7c7b\u578b<\/span><span style=\"color:#0d0016\">\u793a\u4f8b<\/span><\/tr>\n<tbody>\n<tr>\n<td><span style=\"color:#0d0016\">%d<\/span><\/td>\n<td><span style=\"color:#0d0016\">int<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%d&#034;, &amp;x);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#0d0016\">%f<\/span><\/td>\n<td><span style=\"color:#0d0016\">float<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%f&#034;, &amp;y);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#0d0016\">%lf<\/span><\/td>\n<td><span style=\"color:#0d0016\">double<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%lf&#034;, &amp;z);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#0d0016\">%c<\/span><\/td>\n<td><span style=\"color:#0d0016\">char<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%c&#034;, &amp;c);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#0d0016\">%s<\/span><\/td>\n<td><span style=\"color:#0d0016\">\u5b57\u7b26\u4e32&#xff08;char[]&#xff09;<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%s&#034;, str);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#0d0016\">%u<\/span><\/td>\n<td><span style=\"color:#0d0016\">unsigned int<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%u&#034;, &amp;u);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color:#0d0016\">%x<\/span><\/td>\n<td><span style=\"color:#0d0016\">\u5341\u516d\u8fdb\u5236\u6574\u6570<\/span><\/td>\n<td><span style=\"color:#0d0016\">scanf(&#034;%x&#034;, &amp;h);<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#0d0016\">\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">%s \u8bfb\u53d6\u5b57\u7b26\u4e32\u65f6\u9047\u5230\u7a7a\u683c\u6216\u6362\u884c\u7b26\u505c\u6b62&#xff0c;\u53ef\u80fd\u5f15\u53d1\u7f13\u51b2\u533a\u6ea2\u51fa&#xff08;\u5efa\u8bae\u7528 fgets \u66ff\u4ee3&#xff09;\u3002<\/span><\/li>\n<li><span style=\"color:#0d0016\">%lf \u662f double \u7c7b\u578b\u4e13\u7528&#xff0c;float \u9700\u7528 %f\u3002<\/span><\/li>\n<\/ul>\n<hr \/>\n<h6 style=\"background-color:transparent\"><span style=\"color:#0d0016\">9.2.4\u3001\u8d4b\u503c\u5ffd\u7565\u7b26 *<\/span><\/h6>\n<p><span style=\"color:#0d0016\">\u5728\u5360\u4f4d\u7b26\u524d\u52a0 * \u53ef\u5ffd\u7565\u8f93\u5165\u9879&#xff08;\u4e0d\u8d4b\u503c\u7ed9\u53d8\u91cf&#xff09;&#xff0c;\u5e38\u7528\u4e8e\u8df3\u8fc7\u4e0d\u9700\u8981\u7684\u6570\u636e\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u793a\u4f8b&#xff1a;\u8df3\u8fc7\u8f93\u5165\u4e2d\u7684\u65e5\u671f\u90e8\u5206&#xff1a;<\/span><\/p>\n<p>int year, month;<br \/>\nscanf(&#034;%d-%*d-%d&#034;, &amp;year, &amp;month); \/\/ \u8f93\u5165 &#034;2023-05-15&#034;&#xff0c;month \u4e3a 15&#xff0c;\u4e2d\u95f4 05 \u88ab\u5ffd\u7565<\/p>\n<h6><\/h6>\n<\/p>\n<\/p>\n<\/p>\n<\/p>\n<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb79\u6b21\u3002\u5b83\u7684\u7b2c\u2f00\u4e2a\u53c2\u6570\u662f\u2f00\u4e2a\u683c\u5f0f\u5b57\u7b26\u4e32\uff0c\u91cc\u9762\u4f1a\u653e\u7f6e\u5360\u4f4d\u7b26\uff08\u4e0e\u7f16\u8bd1\u5668\u5982\u4f55\u89e3\u8bfb\u7528\u6237\u7684\u8f93\u5165\uff0c\u9700\u8981\u63d0\u53d6\u7684\u6570\u636e\u662f\u4ec0\u4e48\u7c7b\u578b\u3002\u8fd9\u662f\u56e0\u4e3aC\u8bed\u8a00\u7684\u6570\u636e\u90fd\u662f\u6709\u7c7b\u578b\u7684\uff0c\uff08\u4e0eprintf() \u7684\u5360\u4f4d\u7b26\u57fa\u672c\u4e00\u81f4\uff09\uff0cscanf() \u5fc5\u987b\u63d0\u524d\u77e5\u9053\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u7c7b\u578b\uff0c\u624d\u80fd\u5904\u7406\u6570\u636e\u3002sizeof \u662f\u2f00\u4e2a\u5173\u952e\u5b57\uff0c\u4e5f\u662f\u64cd\u4f5c\u7b26\uff0c\u4e13\u95e8\u662f\u7528\u6765\u8ba1\u7b97sizeof\u64cd\u4f5c\u7b26\u6570\u7684\u7c7b\u578b\u957f\u5ea6\u7684\uff0c\u5355\u4f4d\u662f\u5b57\u8282\u3002\u7c7b\u578b\u662f\u7528\u6765\u521b\u5efa\u53d8\u91cf\u7684\u3002\u6bcf\u4e00\u79cd\u6570\u636e\u7c7b\u578b\u90fd\u6709\u81ea\u5df1\u7684\u957f\u5ea6\uff0c\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u80fd\u591f\u521b\u5efa\u51fa\u957f\u5ea6\u4e0d\u540c\u7684\u53d8\u91cf\uff0c\u53d8\u91cf\u957f\u5ea6\u7684\u4e0d \u540c\uff0c\u5b58\u50a8\u7684\u6570\u636e\u8303\u56f4\u5c31\u6709\u6240\u5dee\u5f02\u3002<\/p>\n","protected":false},"author":2,"featured_media":57859,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,190],"topic":[],"class_list":["post-57861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/57861.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb79\u6b21\u3002\u5b83\u7684\u7b2c\u2f00\u4e2a\u53c2\u6570\u662f\u2f00\u4e2a\u683c\u5f0f\u5b57\u7b26\u4e32\uff0c\u91cc\u9762\u4f1a\u653e\u7f6e\u5360\u4f4d\u7b26\uff08\u4e0e\u7f16\u8bd1\u5668\u5982\u4f55\u89e3\u8bfb\u7528\u6237\u7684\u8f93\u5165\uff0c\u9700\u8981\u63d0\u53d6\u7684\u6570\u636e\u662f\u4ec0\u4e48\u7c7b\u578b\u3002\u8fd9\u662f\u56e0\u4e3aC\u8bed\u8a00\u7684\u6570\u636e\u90fd\u662f\u6709\u7c7b\u578b\u7684\uff0c\uff08\u4e0eprintf() \u7684\u5360\u4f4d\u7b26\u57fa\u672c\u4e00\u81f4\uff09\uff0cscanf() \u5fc5\u987b\u63d0\u524d\u77e5\u9053\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u7c7b\u578b\uff0c\u624d\u80fd\u5904\u7406\u6570\u636e\u3002sizeof \u662f\u2f00\u4e2a\u5173\u952e\u5b57\uff0c\u4e5f\u662f\u64cd\u4f5c\u7b26\uff0c\u4e13\u95e8\u662f\u7528\u6765\u8ba1\u7b97sizeof\u64cd\u4f5c\u7b26\u6570\u7684\u7c7b\u578b\u957f\u5ea6\u7684\uff0c\u5355\u4f4d\u662f\u5b57\u8282\u3002\u7c7b\u578b\u662f\u7528\u6765\u521b\u5efa\u53d8\u91cf\u7684\u3002\u6bcf\u4e00\u79cd\u6570\u636e\u7c7b\u578b\u90fd\u6709\u81ea\u5df1\u7684\u957f\u5ea6\uff0c\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u80fd\u591f\u521b\u5efa\u51fa\u957f\u5ea6\u4e0d\u540c\u7684\u53d8\u91cf\uff0c\u53d8\u91cf\u957f\u5ea6\u7684\u4e0d \u540c\uff0c\u5b58\u50a8\u7684\u6570\u636e\u8303\u56f4\u5c31\u6709\u6240\u5dee\u5f02\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/57861.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-15T13:30:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815132955-689f3653283aa.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57861.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/57861.html\",\"name\":\"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-15T13:30:02+00:00\",\"dateModified\":\"2025-08-15T13:30:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/57861.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/57861.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57861.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/57861.html","og_locale":"zh_CN","og_type":"article","og_title":"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb79\u6b21\u3002\u5b83\u7684\u7b2c\u2f00\u4e2a\u53c2\u6570\u662f\u2f00\u4e2a\u683c\u5f0f\u5b57\u7b26\u4e32\uff0c\u91cc\u9762\u4f1a\u653e\u7f6e\u5360\u4f4d\u7b26\uff08\u4e0e\u7f16\u8bd1\u5668\u5982\u4f55\u89e3\u8bfb\u7528\u6237\u7684\u8f93\u5165\uff0c\u9700\u8981\u63d0\u53d6\u7684\u6570\u636e\u662f\u4ec0\u4e48\u7c7b\u578b\u3002\u8fd9\u662f\u56e0\u4e3aC\u8bed\u8a00\u7684\u6570\u636e\u90fd\u662f\u6709\u7c7b\u578b\u7684\uff0c\uff08\u4e0eprintf() \u7684\u5360\u4f4d\u7b26\u57fa\u672c\u4e00\u81f4\uff09\uff0cscanf() \u5fc5\u987b\u63d0\u524d\u77e5\u9053\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u7c7b\u578b\uff0c\u624d\u80fd\u5904\u7406\u6570\u636e\u3002sizeof \u662f\u2f00\u4e2a\u5173\u952e\u5b57\uff0c\u4e5f\u662f\u64cd\u4f5c\u7b26\uff0c\u4e13\u95e8\u662f\u7528\u6765\u8ba1\u7b97sizeof\u64cd\u4f5c\u7b26\u6570\u7684\u7c7b\u578b\u957f\u5ea6\u7684\uff0c\u5355\u4f4d\u662f\u5b57\u8282\u3002\u7c7b\u578b\u662f\u7528\u6765\u521b\u5efa\u53d8\u91cf\u7684\u3002\u6bcf\u4e00\u79cd\u6570\u636e\u7c7b\u578b\u90fd\u6709\u81ea\u5df1\u7684\u957f\u5ea6\uff0c\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u80fd\u591f\u521b\u5efa\u51fa\u957f\u5ea6\u4e0d\u540c\u7684\u53d8\u91cf\uff0c\u53d8\u91cf\u957f\u5ea6\u7684\u4e0d \u540c\uff0c\u5b58\u50a8\u7684\u6570\u636e\u8303\u56f4\u5c31\u6709\u6240\u5dee\u5f02\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/57861.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T13:30:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815132955-689f3653283aa.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/57861.html","url":"https:\/\/www.wsisp.com\/helps\/57861.html","name":"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-15T13:30:02+00:00","dateModified":"2025-08-15T13:30:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/57861.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/57861.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/57861.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C\u8bed\u8a00\u81ea\u5b66\u2014\u2014C\u8bed\u8a00\u6570\u636e\u7c7b\u578b\u548c\u53d8\u91cf"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=57861"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57861\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/57859"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=57861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=57861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=57861"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=57861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}