{"id":197,"date":"2026-02-23T11:26:11","date_gmt":"2026-02-23T03:26:11","guid":{"rendered":"https:\/\/www.sustation.top\/?p=197"},"modified":"2026-02-24T11:14:09","modified_gmt":"2026-02-24T03:14:09","slug":"day3%ef%bc%9a%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%ef%bc%88%e4%ba%8c%ef%bc%89","status":"publish","type":"post","link":"https:\/\/sustation.top\/?p=197","title":{"rendered":"Day3\uff1a\u6570\u636e\u7c7b\u578b\uff08\u4e8c\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u5b9e\u578b\uff08\u6d6e\u70b9\u578b\uff09<\/h2>\n\n\n\n<p>\u4f5c\u7528\uff1a\u7528\u4e8e\u8868\u793a<strong>\u5c0f\u6570<\/strong><\/p>\n\n\n\n<p>\u5355\u7cbe\u5ea6\uff1afloat\uff1b\u53cc\u7cbe\u5ea6\uff1adouble<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b57\u7b26\u578b<\/h2>\n\n\n\n<p>\u4f5c\u7528\uff1a\u7528\u4e8e\u663e\u793a<strong>\u5355\u4e2a<\/strong>\u5b57\u7b26<\/p>\n\n\n\n<p>\u8bed\u6cd5\uff1achar ch = \u2018a'; \uff08 \u4f7f\u7528\u5355\u5f15\u53f7\u5c06\u5b57\u7b26\u62ec\u8d77\u6765\uff0c\u4e14\u53ea\u80fd\u5199\u4e00\u4e2a\u5b57\u7b26\uff09<\/p>\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\n\tchar ch = 'a';\n\tchar ch2 = 'A';\n\tcout &lt;&lt; ch &lt;&lt; endl;\n\tcout &lt;&lt; \"ch\u5360\u7528\u7684\u5185\u5b58\u7a7a\u95f4\u4e3a\" &lt;&lt; sizeof(ch) &lt;&lt;\"\u4e2a\u5b57\u8282\" &lt;&lt; endl;\n        \/\/\u5b57\u7b26\u578b\u53d8\u91cf\u5bf9\u5e94\u7684ASCII\u7f16\u7801\n\tcout &lt;&lt;\"a\u5bf9\u5e94\u7684ASCII\u7f16\u7801\u662f\" &lt;&lt; int(ch) &lt;&lt; endl;\/\/a - 97\n\t\n\tcout &lt;&lt; \"A\u5bf9\u5e94\u7684ASCII\u7f16\u7801\u662f\" &lt;&lt; int(ch2) &lt;&lt; endl;\/\/A - 65\n\t\n\tsystem(\"pause\");\n\treturn 0;\n}<\/code><\/pre>\n\n\n<h2 class=\"wp-block-heading\">\u5b57\u7b26\u4e32\u7c7b\u578b<\/h2>\n\n\n\n<p>\u4f5c\u7528\uff1a\u7528\u4e8e\u8868\u793a\u4e00\u4e32\u5b57\u7b26<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;string&gt;\nusing namespace std;\nint main() {\n\n\t\/\/C\u98ce\u683c\u5b57\u7b26\u4e32\n\tchar str&#91;] = \"hello world\";\n\tcout &lt;&lt; str &lt;&lt; endl;\n\n\t\/\/C++\u98ce\u683c\u5b57\u7b26\u4e32\n\t\/\/\u9700\u8981\u6dfb\u52a0\u5934\u6587\u4ef6 \n\tstring str2 = \"hello world\";\n\tcout &lt;&lt; str2 &lt;&lt; endl;\n\n\n\tsystem(\"pause\");\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8f6c\u4e49\u5b57\u7b26<\/h2>\n\n\n\n<p>\u4f5c\u7528\uff1a\u7528\u4e8e\u8868\u793a\u4e00\u4e9b\u4e0d\u80fd\u663e\u793a\u51fa\u7684ASCII\u7f16\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\n\n\t\/\/\u6362\u884c\u7b26 \\n\n\tcout << \"hello world\\n\";\n\n\t\/\/\u53cd\u659c\u6760 \\\\\n\n\tcout << \"\\\\\" << endl;\n\n\t\/\/\u6c34\u5e73\u5236\u8868\u7b26 \\t\n\tcout << \"aaa\\thelloworld\"<<endl;\n\tcout << \"aaaa\\thelloworld\" << endl;\n\tcout << \"aa\\thelloworld\" << endl;\n\n\tsystem(\"pause\");\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e03\u5c14\u7c7b\u578b bool<\/h2>\n\n\n\n<p>\u4f5c\u7528\uff1a\u4ee3\u8868\u771f\u6216\u5047\u7684\u503c<\/p>\n\n\n\n<p>bool\u7c7b\u578b\u53ea\u6709\u4e24\u4e2a\u503c\uff0c\u5373 \u771f\uff081\uff09\u4e0e\u5047\uff080\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\n\n\t\/\/\u672c\u8d28\u4e0a 1 \u4ee3\u8868\u771f\uff0c0 \u4ee3\u8868\u5047\n\tbool flag = true;\n\tcout << flag << endl;\n\n\tflag = false;\n\tcout << flag << endl;\n\n\t\/\/bool\u7c7b\u578b\u6240\u5360\u5185\u5b58\u7a7a\u95f4\u4e3a1\n\tcout << \"size of bool is \" << sizeof(flag) <<\" byte\"<< endl;\n\n\tsystem(\"pause\");\n\treturn 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u578b\uff08\u6d6e\u70b9\u578b\uff09 \u4f5c\u7528\uff1a\u7528\u4e8e\u8868\u793a\u5c0f\u6570 \u5355\u7cbe\u5ea6\uff1afloat\uff1b\u53cc\u7cbe\u5ea6\uff1adouble \u5b57\u7b26\u578b \u4f5c\u7528\uff1a\u7528\u4e8e\u663e\u793a\u5355\u4e2a\u5b57\u7b26 \u8bed\u6cd5\uff1achar ch &#8230;<\/p>\n","protected":false},"author":1,"featured_media":185,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[13],"tags":[],"class_list":["post-197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sustation.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=197"}],"version-history":[{"count":12,"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":208,"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/posts\/197\/revisions\/208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sustation.top\/index.php?rest_route=\/wp\/v2\/media\/185"}],"wp:attachment":[{"href":"https:\/\/sustation.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sustation.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sustation.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}