{"id":31437,"date":"2025-02-04T10:07:03","date_gmt":"2025-02-04T10:07:03","guid":{"rendered":"http:\/\/toposuranos.com\/material\/?p=31437"},"modified":"2025-02-07T19:31:14","modified_gmt":"2025-02-07T19:31:14","slug":"c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/","title":{"rendered":"C++\u4e2d\u7684\u51fd\u6570"},"content":{"rendered":"<p><head><title>C++\u4e2d\u7684\u51fd\u6570<\/title><\/p>\n<style>\n        p, ul, ol {\n            text-align: justify;\n        }\n        h1, h2 {\n            text-align: center;\n        }<\/p>\n<p>table {\n        width: 100%;\n        border-collapse: collapse;\n        margin: 20px 0;\n        font-size: 18px;\n        text-align: left;\n    }\n    th, td {\n        padding: 12px;\n        border: 1px solid #ddd;\n    }\n    th {\n        background-color: #007BFF;\n        color: white;\n        text-align: center;\n    }\n    tr:nth-child(even) {\n        background-color: #f2f2f2;\n    }\n    tr:hover {\n        background-color: #ddd;\n    }\n    <\/style>\n<p><\/head><body><\/p>\n<header>\n<h1>C++\u4e2d\u7684\u51fd\u6570\uff1a\u7f16\u5199\u6e05\u6670\u4e14\u53ef\u590d\u7528\u4ee3\u7801\u7684\u5173\u952e<\/h1>\n<p><em>\u4f60\u662f\u5426\u6ce8\u610f\u5230\uff0c\u968f\u7740\u7a0b\u5e8f\u89c4\u6a21\u7684\u589e\u957f\uff0c\u4ee3\u7801\u53d8\u5f97\u8d8a\u6765\u8d8a\u96be\u4ee5\u7406\u89e3\u548c\u7ef4\u62a4\uff1f\u5982\u679c\u4f60\u66fe\u7ecf\u89c9\u5f97\u81ea\u5df1\u7684\u4ee3\u7801\u50cf\u4e00\u4e2a\u590d\u6742\u7684\u8ff7\u5bab\uff0c\u90a3\u53ef\u80fd\u662f\u56e0\u4e3a\u4f60\u8fd8\u6ca1\u6709\u5145\u5206\u5229\u7528C++\u7684\u51fd\u6570\u3002\u51fd\u6570\u5c31\u50cf\u6784\u9020\u6a21\u5757\uff0c\u5141\u8bb8\u5c06\u7a0b\u5e8f\u5212\u5206\u4e3a\u53ef\u7ba1\u7406\u7684\u90e8\u5206\uff0c\u4f7f\u4ee3\u7801\u66f4\u6613\u8bfb\u3001\u66f4\u6613\u7ef4\u62a4\uff0c\u5e76\u4e14\u66f4\u4f18\u5316\u3002\u5728\u672c\u8bfe\u7a0b\u4e2d\uff0c\u4f60\u5c06\u5b66\u4e60\u5982\u4f55\u6709\u6548\u5730\u4f7f\u7528\u51fd\u6570\uff0c\u4ee5\u6539\u5584\u4ee3\u7801\u7684\u7ec4\u7ec7\u7ed3\u6784\uff0c\u7f16\u5199\u66f4\u7ed3\u6784\u5316\u7684\u7a0b\u5e8f\uff0c\u5e76\u4f7f\u4f60\u7684C++\u5f00\u53d1\u66f4\u52a0\u4e13\u4e1a\u548c\u9ad8\u6548\u3002<\/em><\/p>\n<\/header>\n<section>\n<h2>\u5b66\u4e60\u76ee\u6807<\/h2>\n<p style=\"text-align:center;\">\u5b8c\u6210\u672c\u8bfe\u7a0b\u540e\uff0c\u4f60\u5c06\u5b66\u4f1a\uff1a<\/p>\n<ul>\n<li><strong>\u7406\u89e3<\/strong> \u51fd\u6570\u7684\u76ee\u7684\u4ee5\u53ca\u5b83\u4eec\u5728C++\u4e2d\u7684\u91cd\u8981\u6027\u3002<\/li>\n<li><strong>\u521b\u5efa<\/strong> \u6b63\u786e\u7684\u51fd\u6570\uff0c\u786e\u4fdd\u4ee3\u7801\u7ed3\u6784\u6e05\u6670\u3002<\/li>\n<li><strong>\u8c03\u7528<\/strong> \u51fd\u6570\u5e76\u7406\u89e3\u5b83\u4eec\u7684\u6267\u884c\u65b9\u5f0f\u3002<\/li>\n<li><strong>\u533a\u5206<\/strong> \u8fd4\u56de\u503c\u51fd\u6570\u4e0e\u4ec5\u6267\u884c\u6307\u4ee4\u7684\u51fd\u6570\u3002<\/li>\n<li><strong>\u6bd4\u8f83<\/strong> \u4e0d\u540c\u7684\u51fd\u6570\u5b9a\u4e49\u65b9\u5f0f\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9009\u62e9\u6700\u4f73\u65b9\u6848\u3002<\/li>\n<\/ul>\n<\/section>\n<p style=\"text-align:center;\">\n<strong><u>\u76ee\u5f55<\/u><\/strong><br \/>\n<a href=\"#1\">\u51fd\u6570\u7684\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49<\/a><br \/>\n<a href=\"#2\">\u65b9\u6cd5\u4e00\uff1a\u5148\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49<\/a><br \/>\n<a href=\"#3\">\u65b9\u6cd5\u4e8c\uff1a\u58f0\u660e\u540e\u5148\u5b9e\u73b0\u518d\u8c03\u7528<\/a><br \/>\n<a href=\"#4\">\u8fd4\u56de\u503c\u7684\u4f20\u9012<\/a><br \/>\n<a href=\"#5\">\u9012\u5f52\uff1a\u8c03\u7528\u81ea\u8eab\u7684\u51fd\u6570<\/a><br \/>\n<a href=\"#6\">\u51fd\u6570\u7684\u591a\u8fd4\u56de\u503c<\/a><br \/>\n<a href=\"#7\">\u51fd\u6570\u91cd\u8f7d\uff08overloading\uff09<\/a><br \/>\n<a href=\"#8\">C++\u4e2d\u7684\u5185\u8054\u51fd\u6570\uff08inline functions\uff09<\/a><br \/>\n<a href=\"#9\">\u5173\u4e8eC++\u51fd\u6570\u7684\u6700\u7ec8\u601d\u8003<\/a><\/p>\n<p><center><iframe class=\"lazyload\" width=\"560\" height=\"315\" data-src=\"https:\/\/www.youtube.com\/embed\/1SeIwMqpXgM?si=vYxfnmqmkLyXeaY9\" title=\"YouTube\u89c6\u9891\u64ad\u653e\u5668\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/center><\/p>\n<section><a name=\"1\"><\/a><\/p>\n<h2>\u51fd\u6570\u7684\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49<\/h2>\n<p>\n\u5728C++\u4e2d\uff0c\u51fd\u6570\u662f\u53ef\u91cd\u590d\u4f7f\u7528\u7684\u4ee3\u7801\u5757\uff0c\u4f7f\u7a0b\u5e8f\u7ed3\u6784\u66f4\u52a0\u6a21\u5757\u5316\u548c\u6709\u7ec4\u7ec7\u3002\u6bcf\u4e2a\u51fd\u6570\u5c01\u88c5\u4e00\u4e2a\u7279\u5b9a\u7684\u4efb\u52a1\uff0c\u6709\u52a9\u4e8e\u63d0\u9ad8\u4ee3\u7801\u7684\u6e05\u6670\u5ea6\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u8981\u5728\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u51fd\u6570\uff0c\u6211\u4eec\u9700\u8981\u9075\u5faa\u4e09\u4e2a\u57fa\u672c\u6b65\u9aa4\uff1a<strong>\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u3002<\/strong>\n<\/p>\n<p>\u8fd9\u4e09\u4e2a\u6982\u5ff5\u81f3\u5173\u91cd\u8981\uff0c\u6bcf\u4e2a\u6982\u5ff5\u5728\u4ee3\u7801\u7ed3\u6784\u4e2d\u90fd\u626e\u6f14\u7740\u7279\u5b9a\u7684\u89d2\u8272\u3002\u8ba9\u6211\u4eec\u8be6\u7ec6\u4e86\u89e3\u6bcf\u4e2a\u90e8\u5206\u3002<\/p>\n<ol>\n<li><strong>\u51fd\u6570\u7684\u58f0\u660e<\/strong>\n<p>\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u51fd\u6570\u4e4b\u524d\uff0c\u7f16\u8bd1\u5668\u5fc5\u987b\u77e5\u9053\u5b83\u7684\u5b58\u5728\u3002\u8fd9\u662f\u901a\u8fc7<strong>\u51fd\u6570\u58f0\u660e\u6216\u51fd\u6570\u539f\u578b<\/strong>\u5b9e\u73b0\u7684\u3002<\/p>\n<p>\u51fd\u6570\u58f0\u660e\u5411\u7f16\u8bd1\u5668\u63d0\u4f9b\u4e09\u4e2a\u5173\u952e\u4fe1\u606f\uff1a<\/p>\n<ul>\n<li><strong>\u51fd\u6570\u8fd4\u56de\u7684\u6570\u636e\u7c7b\u578b<\/strong>\uff08\u5982\u679c\u6ca1\u6709\u8fd4\u56de\u503c\uff0c\u5219\u4f7f\u7528void\uff09\u3002<\/li>\n<li><strong>\u51fd\u6570\u7684\u540d\u79f0\u3002<\/strong><\/li>\n<li><strong>\u51fd\u6570\u7684\u53c2\u6570\u5217\u8868<\/strong>\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u6570\u636e\u7c7b\u578b\u3002<\/li>\n<\/ul>\n<p><\/p>\n<p>\u51fd\u6570\u58f0\u660e\u7684\u4e00\u822c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">fan_hui_lei_xing han_shu_ming (can_shu_lie_biao);\r\n<\/pre>\n<p>\u901a\u5e38\uff0c\u51fd\u6570\u58f0\u660e\u653e\u5728<code>main()<\/code>\u4e4b\u524d\uff0c\u6216\u8005\u5728\u591a\u6587\u4ef6\u7a0b\u5e8f\u4e2d\u653e\u5165\u5934\u6587\u4ef6\uff08.h\uff09\u3002<\/p>\n<\/li>\n<li><strong>\u51fd\u6570\u7684\u8c03\u7528<\/strong>\n<p>\u58f0\u660e\u51fd\u6570\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8c03\u7528\u5b83\uff0c\u4f7f\u5176\u6267\u884c\u5b9a\u4e49\u7684\u529f\u80fd\u3002<\/p>\n<p>\u8c03\u7528\u51fd\u6570\u65f6\uff1a<\/p>\n<ul>\n<li>\u6267\u884c\u5176\u5b9a\u4e49\u4e2d\u5305\u542b\u7684\u4ee3\u7801\u3002<\/li>\n<li>\u5982\u679c\u51fd\u6570\u6709\u8fd4\u56de\u503c\uff0c\u8be5\u503c\u53ef\u4ee5\u5b58\u50a8\u5728\u53d8\u91cf\u4e2d\u6216\u76f4\u63a5\u7528\u4e8e\u8868\u8fbe\u5f0f\u3002<\/li>\n<li>\u5982\u679c\u51fd\u6570\u662f<code>void<\/code>\u7c7b\u578b\uff0c\u5b83\u53ea\u6267\u884c\u6307\u4ee4\uff0c\u4e0d\u8fd4\u56de\u4efb\u4f55\u503c\u3002<\/li>\n<\/ul>\n<p><\/p>\n<p>\u51fd\u6570\u8c03\u7528\u7684\u8bed\u6cd5\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u5199\u51fa\u51fd\u6570\u540d\uff0c\u5e76\u5728\u62ec\u53f7\u5185\u63d0\u4f9b\u53c2\u6570\uff08\u5982\u679c\u9700\u8981\uff09\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nhan_shu_ming(can_shu);\r\n<\/pre>\n<\/li>\n<li><strong>\u51fd\u6570\u7684\u5b9a\u4e49<\/strong>\n<p>\u51fd\u6570\u5b9a\u4e49\u662f\u5b9e\u73b0\u5176\u529f\u80fd\u7684\u5730\u65b9\u3002\u8fd9\u91cc\u6307\u5b9a\u4e86\u5728\u8c03\u7528\u51fd\u6570\u65f6\u6267\u884c\u7684\u6307\u4ee4\u3002<\/p>\n<p>\u51fd\u6570\u5b9a\u4e49\u7684\u4e00\u822c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nfan_hui_lei_xing han_shu_ming (can_shu_lie_biao) {\r\n    \/\/ han_shu_ti: yao_zhi_xing_de_zhi_ling\r\n    return zhi; \/\/ (ru_guo_han_shu_you_fan_hui_zhi)\r\n}\r\n<\/pre>\n<p>\u6bcf\u4e2a\u51fd\u6570\u5b9a\u4e49\u5fc5\u987b\u9075\u5faa\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n<ul>\n<li>\u5982\u679c\u51fd\u6570\u5df2\u58f0\u660e\uff0c\u5219\u5b9a\u4e49\u5fc5\u987b\u4e0e\u58f0\u660e\u5339\u914d\u3002<\/li>\n<li>\u5982\u679c\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u503c\uff08\u4f8b\u5982<code>int<\/code>\uff09\uff0c\u5fc5\u987b\u5305\u542b<code>return<\/code>\u8bed\u53e5\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u503c\u3002<\/li>\n<li>\u5982\u679c\u51fd\u6570\u6ca1\u6709\u8fd4\u56de\u503c\uff08<code>void<\/code>\uff09\uff0c\u5b83\u53ea\u9700\u6267\u884c\u4ee3\u7801\u5757\u5185\u7684\u6307\u4ee4\uff0c\u65e0\u9700<code>return<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u6267\u884c\u6d41\u7a0b<\/h3>\n<p>\u5f53\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u51fd\u6570\u6309\u7167\u5b83\u4eec\u5728<code>main()<\/code>\u4e2d\u7684\u8c03\u7528\u987a\u5e8f\u6267\u884c\u3002\u6267\u884c\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u7f16\u8bd1\u5668\u8bc6\u522b\u51fd\u6570\u58f0\u660e\u3002<\/li>\n<li>\u5728<code>main()<\/code>\u4e2d\uff0c\u9047\u5230\u51fd\u6570\u8c03\u7528\u65f6\uff0c\u7a0b\u5e8f\u63a7\u5236\u6d41\u8df3\u8f6c\u5230\u51fd\u6570\u5b9a\u4e49\u3002<\/li>\n<li>\u6267\u884c\u51fd\u6570\u4e2d\u7684\u6307\u4ee4\u3002<\/li>\n<li>\u5982\u679c\u51fd\u6570\u6709\u8fd4\u56de\u503c\uff0c\u8be5\u503c\u4f1a\u8fd4\u56de\u5230\u8c03\u7528\u51fd\u6570\u7684\u4ee3\u7801\u4f4d\u7f6e\u3002<\/li>\n<li>\u7a0b\u5e8f\u6d41\u7a0b\u8fd4\u56de\u5230<code>main()<\/code>\u6216\u8c03\u7528\u5b83\u7684\u51fd\u6570\u3002<\/li>\n<\/ol>\n<h3>\u63d0\u524d\u58f0\u660e\u7684\u91cd\u8981\u6027<\/h3>\n<p>\u5728\u4f7f\u7528\u51fd\u6570\u4e4b\u524d\u58f0\u660e\u5b83\u662f\u81f3\u5173\u91cd\u8981\u7684\uff0c\u56e0\u4e3aC++\u7f16\u8bd1\u5668\u6309\u81ea\u4e0a\u800c\u4e0b\u7684\u987a\u5e8f\u89e3\u6790\u4ee3\u7801\u3002\u5982\u679c\u5728\u5b9a\u4e49\u6216\u58f0\u660e\u4e4b\u524d\u8c03\u7528\u51fd\u6570\uff0c\u4f1a\u5bfc\u81f4\u9519\u8bef\u3002<\/p>\n<p>\u4e3b\u8981\u6709\u4e24\u79cd\u65b9\u5f0f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1a<\/p>\n<ol>\n<li>\u5728<code>main()<\/code>\u4e4b\u524d\u58f0\u660e\u51fd\u6570\uff0c\u5e76\u5728\u4e4b\u540e\u5b9a\u4e49\u5b83\uff08\u5982\u524d\u9762\u4ecb\u7ecd\u7684\u65b9\u5f0f\uff09\u3002<\/li>\n<li>\u5728<code>main()<\/code>\u4e4b\u524d\u5b9a\u4e49\u51fd\u6570\uff0c\u907f\u514d\u63d0\u524d\u58f0\u660e\u3002<\/li>\n<\/ol>\n<p>\u8fd9\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\uff0c\u4f46\u7b2c\u4e00\u79cd\u65b9\u6cd5\u5728\u5927\u578b\u7a0b\u5e8f\u4e2d\u66f4\u6709\u7528\uff0c\u5c24\u5176\u662f\u6d89\u53ca\u591a\u4e2a\u6587\u4ef6\u65f6\u3002<\/p>\n<\/section>\n<section><a name=\"2\"><\/a><\/p>\n<h2>\u65b9\u6cd5\uff1a\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49<\/h2>\n<p>\u5728C++\u4e2d\uff0c\u7ec4\u7ec7\u51fd\u6570\u7684\u4e00\u79cd\u5e38\u89c1\u65b9\u6cd5\u662f<strong>\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49\u3002<\/strong> \u6309\u7167\u8fd9\u79cd\u903b\u8f91\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u4ee3\u7801\u5206\u4e3a\u4e09\u4e2a\u57fa\u672c\u9636\u6bb5\uff1a<\/p>\n<ol>\n<li><strong>\u58f0\u660e\uff1a<\/strong> \u5728\u4f7f\u7528\u51fd\u6570\u4e4b\u524d\uff0c\u5411\u7f16\u8bd1\u5668\u58f0\u660e\u5176\u5b58\u5728\uff0c\u6307\u5b9a\u51fd\u6570\u540d\u3001\u8fd4\u56de\u7c7b\u578b\u53ca\u53c2\u6570\uff08\u5982\u679c\u6709\uff09\u3002<\/li>\n<li><strong>\u8c03\u7528\uff1a<\/strong> \u5728\u4ee3\u7801\u4e3b\u51fd\u6570\uff08\u901a\u5e38\u662f<code>main()<\/code>\uff09\u4e2d\u8c03\u7528\u51fd\u6570\uff0c\u6267\u884c\u5176\u529f\u80fd\u3002<\/li>\n<li><strong>\u5b9a\u4e49\uff1a<\/strong> \u8be6\u7ec6\u5b9e\u73b0\u51fd\u6570\uff0c\u6307\u5b9a\u5f53\u51fd\u6570\u88ab\u8c03\u7528\u65f6\u6267\u884c\u7684\u6307\u4ee4\u3002<\/li>\n<\/ol>\n<p>\u8fd9\u79cd\u7ed3\u6784\u6709\u52a9\u4e8e\u63d0\u9ad8\u4ee3\u7801\u7684\u7ec4\u7ec7\u6027\uff0c\u4f7f\u5176\u66f4\u6613\u7ef4\u62a4\u548c\u6269\u5c55\u3002\u8ba9\u6211\u4eec\u6765\u770b\u4e00\u4e2a\u793a\u4f8b\uff0c\u8be5\u793a\u4f8b\u91c7\u7528\u8fd9\u79cd\u65b9\u6cd5\uff1a<\/p>\n<h3>\u793a\u4f8b\uff1a\u51fd\u6570 <code>consoladice()<\/code><\/h3>\n<p>\u5728\u4e0b\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9075\u5faa<strong>\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49<\/strong>\u7684\u987a\u5e8f\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\n\/\/ shou xian sheng ming han shu\r\nvoid consoladice();\r\n\r\nint main() {\r\n    \/\/ diao yong han shu\r\n    consoladice();\r\n    return 0;\r\n}\r\n\r\n\/\/ ding yi xian qian sheng ming de han shu, xiang xi qi nei bu shi xian\r\nvoid consoladice() {\r\n    cout &lt;&lt; &quot;zhe shi yi tiao jian dan de wen ben huo zifu chuan.&quot; &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;xian zai wo gei ni kan yi ge shu zi wu. zhe li shi: &quot; &lt;&lt; 5 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;kan kan 10\/5 de jie guo shi shen me. jie guo shi: &quot; &lt;&lt; 10\/5 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;yi zhong chang jian de pi de jin si shi 22\/7. jie guo shi: &quot; &lt;&lt; 22\/7 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;zai C++ zhong, 22\/7 he 22.0\/7 bing bu yi yang.&quot; &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;zhi yao zuo zhe yang de xiao bian hua, wo men ke yi kan dao 22.0\/7 de jie guo shi &quot; &lt;&lt; 22.0\/7 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;ni bu jue de zhe yang de jie guo geng hao ma?&quot; &lt;&lt; endl;\r\n}\r\n<\/pre>\n<p>\u8be5\u4ee3\u7801\u7684\u9884\u671f\u8f93\u51fa\u4e3a\uff1a<\/p>\n<p><code>zhe shi yi tiao jian dan de wen ben huo zifu chuan.<br \/>\nxian zai wo gei ni kan yi ge shu zi wu. zhe li shi: 5<br \/>\nkan kan 10\/5 de jie guo shi shen me. jie guo shi: 2<br \/>\nyi zhong chang jian de pi de jin si shi 22\/7. jie guo shi: 3<br \/>\nzai C++ zhong, 22\/7 he 22.0\/7 bing bu yi yang.<br \/>\nzhi yao zuo zhe yang de xiao bian hua, wo men ke yi kan dao 22.0\/7 de jie guo shi 3.14286<br \/>\nni bu jue de zhe yang de jie guo geng hao ma?<\/code><\/p>\n<p>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u201c\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49\u201d\u65b9\u6cd5\uff0c\u8ba9\u6211\u4eec\u5173\u6ce8\u4ee3\u7801\u7684\u4e09\u4e2a\u5173\u952e\u90e8\u5206\uff1a<\/p>\n<ol>\n<li><strong>\u7b2c5\u884c\uff1a\u51fd\u6570\u58f0\u660e<\/strong>\n<ul>\n<li><code>void consoladice();<\/code> \u544a\u8bc9\u7f16\u8bd1\u5668\u4ee3\u7801\u4e2d\u5b58\u5728\u4e00\u4e2a\u540d\u4e3a<code>consoladice()<\/code>\u7684\u51fd\u6570\u3002<\/li>\n<li>\u5176\u8fd4\u56de\u7c7b\u578b\u4e3a<code>void<\/code>\uff0c\u8868\u793a\u8be5\u51fd\u6570\u4e0d\u8fd4\u56de\u4efb\u4f55\u503c\u3002<\/li>\n<li>\u5c3d\u7ba1\u6b64\u65f6\u5c1a\u672a\u5b9e\u73b0<code>consoladice()<\/code>\u7684\u529f\u80fd\uff0c\u4f46\u8fd9\u4e2a\u58f0\u660e\u4f7f\u7f16\u8bd1\u5668\u5728\u4e4b\u540e\u7684\u4ee3\u7801\u4e2d\u8bc6\u522b\u8be5\u51fd\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7b2c9\u884c\uff1a\u51fd\u6570\u8c03\u7528<\/strong>\n<ul>\n<li>\u5728<code>main()<\/code>\u51fd\u6570\u5185\u90e8\uff0c\u8bed\u53e5 <code>consoladice();<\/code> \u89e6\u53d1\u8be5\u51fd\u6570\u7684\u6267\u884c\u3002<\/li>\n<li>\u7531\u4e8e\u4e4b\u524d\u7684\u58f0\u660e\uff0c\u7f16\u8bd1\u5668\u5df2\u77e5\u9053<code>consoladice()<\/code>\u7684\u5b58\u5728\u3002<\/li>\n<li>\u5f53\u8c03\u7528\u8be5\u51fd\u6570\u65f6\uff0c\u7a0b\u5e8f\u63a7\u5236\u6d41\u8df3\u8f6c\u5230\u5176\u5b9a\u4e49\u5904\uff0c\u5e76\u6267\u884c\u5176\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7b2c14\u81f322\u884c\uff1a\u51fd\u6570\u5b9a\u4e49<\/strong>\n<ul>\n<li>\u5728\u8fd9\u91cc\uff0c<code>consoladice()<\/code> \u7684\u5b9e\u73b0\u88ab\u8be6\u7ec6\u5b9a\u4e49\u3002<\/li>\n<li>\u8be5\u51fd\u6570\u5728\u63a7\u5236\u53f0\u4e0a\u8f93\u51fa\u591a\u4e2a\u4fe1\u606f\uff0c\u5305\u62ec\u6587\u672c\u3001\u6570\u5b57\u548c\u6570\u5b66\u8ba1\u7b97\u7ed3\u679c\u3002<\/li>\n<li>\u503c\u5f97\u6ce8\u610f\u7684\u662f <code>22\/7<\/code> \u548c <code>22.0\/7<\/code> \u4e4b\u95f4\u7684\u533a\u522b\u3002\u5f53\u4f7f\u7528 <code>22\/7<\/code> \u65f6\uff0c\u4e24\u4e2a\u6570\u90fd\u662f\u6574\u6570\uff0c\u56e0\u6b64\u6267\u884c\u7684\u662f\u6574\u6570\u9664\u6cd5\uff0c\u7ed3\u679c\u4e3a <code>3<\/code>\u3002\u4f46\u5f53\u4f7f\u7528 <code>22.0\/7<\/code> \u65f6\uff0c\u8fd0\u7b97\u4f1a\u81ea\u52a8\u8f6c\u6362\u4e3a\u6d6e\u70b9\u8fd0\u7b97\uff0c\u7ed3\u679c\u4e3a <code>3.14286<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/section>\n<section><a name=\"3\"><\/a><\/p>\n<h2>\u65b9\u6cd5\uff1a\u5148\u58f0\u660e\u5e76\u5b9e\u73b0\uff0c\u518d\u8c03\u7528<\/h2>\n<p>\u5728C++\u4e2d\uff0c\u9664\u4e86<strong>\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49<\/strong>\u7684\u65b9\u6cd5\u5916\uff0c\u8fd8\u6709\u53e6\u4e00\u79cd\u7ec4\u7ec7\u51fd\u6570\u7684\u65b9\u5f0f\uff1a<strong>\u5148\u58f0\u660e\u5e76\u5b9e\u73b0\uff0c\u518d\u8c03\u7528\u3002<\/strong> \u8fd9\u79cd\u65b9\u6cd5\u5728\u5b9a\u4e49\u51fd\u6570\u65f6\uff0c\u4e0d\u9700\u8981\u5355\u72ec\u7684\u58f0\u660e\uff0c\u800c\u662f\u5728<code>main()<\/code>\u4e4b\u524d\u76f4\u63a5\u5b9a\u4e49\u51fd\u6570\u3002<\/p>\n<p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c\u6211\u4eec\u4e0d\u9700\u8981\u5148\u58f0\u660e\u51fd\u6570\u518d\u5728<code>main()<\/code>\u540e\u9762\u5b9a\u4e49\uff0c\u800c\u662f\u76f4\u63a5\u5728<code>main()<\/code>\u4e4b\u524d\u58f0\u660e\u5e76\u5b9e\u73b0\u51fd\u6570\u3002\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4ee3\u7801\u66f4\u52a0\u7d27\u51d1\uff0c\u5728\u5c0f\u578b\u7a0b\u5e8f\u4e2d\u66f4\u5bb9\u6613\u9605\u8bfb\u3002<\/p>\n<p>\u6b64\u65b9\u6cd5\u7684\u4e00\u822c\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\/\/ zai main() qian ding yi han shu\r\nfan_hui_lei_xing han_shu_ming(can_shu_lie_biao) {\r\n    \/\/ han_shu_ti\r\n    return zhi; \/\/ ru_guo_xu_yao\r\n}\r\n\r\nint main() {\r\n    \/\/ diao yong han shu\r\n    han_shu_ming(can_shu);\r\n}\r\n<\/pre>\n<p>\u7531\u4e8e\u51fd\u6570\u5728<code>main()<\/code>\u4e4b\u524d\u5df2\u5b9a\u4e49\uff0c\u7f16\u8bd1\u5668\u5728\u8c03\u7528\u5b83\u65f6\u5df2\u7ecf\u77e5\u9053\u5176\u5b58\u5728\uff0c\u56e0\u6b64\u65e0\u9700\u5355\u72ec\u58f0\u660e\u3002<\/p>\n<h3><strong>\u793a\u4f8b\uff1a\u4e0d\u9700\u8981\u5355\u72ec\u58f0\u660e\u7684 <code>consoladice()<\/code> \u51fd\u6570<\/strong><\/h3>\n<p>\u73b0\u5728\u6765\u770b\u4e00\u4e2a\u5b9e\u9645\u793a\u4f8b\uff0c\u5e94\u7528\u8fd9\u79cd\u65b9\u6cd5\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\n\/\/ zai diao yong zhi qian ding yi han shu\r\nvoid consoladice() {\r\n    cout &lt;&lt; &quot;zhe shi yi tiao jian dan de wen ben huo zifu chuan.&quot; &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;xian zai wo gei ni kan yi ge shu zi wu. zhe li shi: &quot; &lt;&lt; 5 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;kan kan 10\/5 de jie guo shi shen me. jie guo shi: &quot; &lt;&lt; 10\/5 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;yi zhong chang jian de pi de jin si shi 22\/7. jie guo shi: &quot; &lt;&lt; 22\/7 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;zai C++ zhong, 22\/7 he 22.0\/7 bing bu yi yang.&quot; &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;zhi yao zuo zhe yang de xiao bian hua, wo men ke yi kan dao 22.0\/7 de jie guo shi &quot; &lt;&lt; 22.0\/7 &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;ni bu jue de zhe yang de jie guo geng hao ma?&quot; &lt;&lt; endl;\r\n}\r\n\r\nint main() {\r\n    \/\/ diao yong han shu\r\n    consoladice();\r\n    return 0;\r\n}\r\n<\/pre>\n<p>\u5728\u8be5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff1a<\/p>\n<ol>\n<li><strong>\u5728\u7b2c5\u81f313\u884c\uff0c\u51fd\u6570\u7684\u58f0\u660e\u548c\u5b9a\u4e49\u5408\u5e76<\/strong>\n<p><code>consoladice()<\/code> \u76f4\u63a5\u5728<code>main()<\/code>\u4e4b\u524d\u5b9a\u4e49\uff0c\u65e0\u9700\u989d\u5916\u58f0\u660e\u3002<\/p>\n<\/li>\n<li><strong>\u5728\u7b2c17\u884c\uff0c\u51fd\u6570\u5728<code>main()<\/code>\u5185\u88ab\u8c03\u7528<\/strong>\n<p>\u7531\u4e8e\u8be5\u51fd\u6570\u5df2\u88ab\u5b9a\u4e49\uff0c\u7f16\u8bd1\u5668\u80fd\u6b63\u786e\u89e3\u6790\u5e76\u6267\u884c\u5b83\u3002<\/p>\n<\/li>\n<li><strong>\u8fd0\u884c\u7ed3\u679c\u5b8c\u5168\u76f8\u540c<\/strong>\n<p>\u4e0e\u201c\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49\u201d\u65b9\u6cd5\u76f8\u6bd4\uff0c\u8be5\u65b9\u6cd5\u7684\u6267\u884c\u7ed3\u679c\u5b8c\u5168\u76f8\u540c\uff0c\u4f46\u4ee3\u7801\u7ed3\u6784\u66f4\u52a0\u7d27\u51d1\u3002<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u2705 \u4f18\u52bf\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728\u5c0f\u578b\u7a0b\u5e8f\u4e2d\uff0c\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u660e\u4e86\u3002<\/li>\n<li>\u65e0\u9700\u989d\u5916\u58f0\u660e\uff0c\u51cf\u5c11\u4ee3\u7801\u884c\u6570\u3002<\/li>\n<li>\u5728\u6240\u6709\u51fd\u6570\u90fd\u4f4d\u4e8e\u540c\u4e00\u6587\u4ef6\u7684\u5c0f\u578b\u811a\u672c\u4e2d\uff0c\u4fbf\u4e8e\u9605\u8bfb\u3002<\/li>\n<\/ul>\n<p><strong>\u274c \u52a3\u52bf\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728\u5927\u578b\u7a0b\u5e8f\u4e2d\uff0c\u5982\u679c<code>main()<\/code>\u4e4b\u524d\u5b9a\u4e49\u4e86\u5927\u91cf\u51fd\u6570\uff0c\u53ef\u80fd\u4f1a\u5f71\u54cd\u4ee3\u7801\u7684\u7ec4\u7ec7\u6027\u3002<\/li>\n<li>\u5982\u679c\u4f7f\u7528\u591a\u4e2a\u6587\u4ef6\uff08.h \u548c .cpp\uff09\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u592a\u9002\u7528\uff0c\u901a\u5e38\u5efa\u8bae\u5c06\u58f0\u660e\u548c\u5b9e\u73b0\u5206\u79bb\u3002<\/li>\n<\/ul>\n<\/section>\n<p><center><iframe class=\"lazyload\" width=\"560\" height=\"315\" data-src=\"https:\/\/www.youtube.com\/embed\/AkIhpuZP80k?si=yT8732AKk2i-QBLe\" title=\"YouTube \u89c6\u9891\u64ad\u653e\u5668\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/center><\/p>\n<section><a name=\"4\"><\/a><\/p>\n<h2>\u8fd4\u56de\u503c\u7684\u4f20\u9012<\/h2>\n<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5df2\u7ecf\u5b66\u4e60\u4e86\u6267\u884c\u6307\u4ee4\u4f46\u4e0d\u8fd4\u56de\u4efb\u4f55\u503c\u7684\u51fd\u6570\u3002\u7136\u800c\uff0c\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u51fd\u6570\u9700\u8981\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u4ee5\u4fbf\u7528\u4e8e\u5176\u4ed6\u8ba1\u7b97\u6216\u5b58\u50a8\u5230\u53d8\u91cf\u4e2d\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3a\u8fd4\u56de\u503c\u7684\u4f20\u9012\u3002<\/p>\n<p>\u5728\u672c\u8282\u4e2d\uff0c\u6211\u4eec\u5c06\u5b66\u4e60\u8fd4\u56de\u503c\u51fd\u6570\u7684\u5de5\u4f5c\u539f\u7406\uff0c\u5b83\u4eec\u4e0e<code>void<\/code>\u7c7b\u578b\u51fd\u6570\u7684\u533a\u522b\uff0c\u4ee5\u53ca\u5982\u4f55\u5728C++\u4e2d\u5229\u7528\u8fd9\u4e00\u673a\u5236\u3002<\/p>\n<h3>\u5b9e\u8df5\u793a\u4f8b\uff1a\u8ba1\u7b97\u77e9\u5f62\u7684\u9762\u79ef<\/h3>\n<p>\u4e3a\u4e86\u6f14\u793a\u8fd4\u56de\u503c\u7684\u4f20\u9012\uff0c\u6211\u4eec\u5c06\u5b9e\u73b0\u4e00\u4e2a\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u63a5\u6536\u77e9\u5f62\u7684\u5e95\u8fb9\u548c\u9ad8\uff0c\u5e76\u8ba1\u7b97\u5176\u9762\u79ef\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\n\/\/ han shu ji suan ju xing de mian ji, bing fan hui jie guo\r\ndouble calcularArea(double base, double altura) {\r\n    return base * altura;\r\n}\r\n\r\nint main() {\r\n    double base, altura;\r\n    \r\n    \/\/ qing qiu yong hu shu ru shu ju\r\n    cout &lt;&lt; &quot;qing shu ru ju xing de di bian: &quot;;\r\n    cin &gt;&gt; base;\r\n    cout &lt;&lt; &quot;qing shu ru ju xing de gao: &quot;;\r\n    cin &gt;&gt; altura;\r\n\r\n    \/\/ diao yong han shu, jiang jie guo cun chu dao bian liang zhong\r\n    double area = calcularArea(base, altura);\r\n\r\n    \/\/ xian shi jie guo\r\n    cout &lt;&lt; &quot;ju xing de mian ji shi: &quot; &lt;&lt; area &lt;&lt; endl;\r\n    \r\n    return 0;\r\n}\r\n<\/pre>\n<ol>\n<li><strong>\u51fd\u6570 <code>calcularArea()<\/code> \u8fd4\u56de\u4e00\u4e2a\u503c<\/strong>\n<ul>\n<li>\u51fd\u6570\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a<code>base<\/code>\uff08\u5e95\u8fb9\uff09\u548c<code>altura<\/code>\uff08\u9ad8\uff09\u3002<\/li>\n<li>\u901a\u8fc7\u4e58\u6cd5\u8ba1\u7b97\u9762\u79ef\uff1a<code>base * altura<\/code>\u3002<\/li>\n<li>\u4f7f\u7528 <code>return<\/code> \u8bed\u53e5\u5c06\u8ba1\u7b97\u7ed3\u679c\u8fd4\u56de\u7ed9\u8c03\u7528\u5b83\u7684\u7a0b\u5e8f\u90e8\u5206\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5728 <code>main()<\/code> \u4e2d\u4f7f\u7528\u8fd4\u56de\u503c<\/strong>\n<ul>\n<li>\u7528\u6237\u8f93\u5165<code>base<\/code>\u548c<code>altura<\/code>\u7684\u503c\u3002<\/li>\n<li>\u8c03\u7528\u51fd\u6570<code>calcularArea()<\/code>\uff0c\u5e76\u5c06\u5176\u8fd4\u56de\u503c\u5b58\u50a8\u5728\u53d8\u91cf<code>area<\/code>\u4e2d\u3002<\/li>\n<li>\u6700\u7ec8\uff0c\u5728\u63a7\u5236\u53f0\u4e0a\u663e\u793a\u8ba1\u7b97\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4e0e<code>void<\/code>\u51fd\u6570\u7684\u5173\u952e\u533a\u522b<\/strong>\n<p>\u5982\u679c<code>calcularArea()<\/code>\u662f<code>void<\/code>\u7c7b\u578b\uff0c\u6211\u4eec\u9700\u8981\u5728\u51fd\u6570\u5185\u90e8\u76f4\u63a5\u8f93\u51fa\u7ed3\u679c\uff0c\u800c\u4e0d\u662f\u8fd4\u56de\u8ba1\u7b97\u7ed3\u679c\u4ee5\u4f9b<code>main()<\/code>\u4f7f\u7528\u3002<\/p>\n<\/li>\n<\/ol>\n<h3>\u793a\u4f8b\uff1a\u5224\u65ad\u4e00\u4e2a\u6570\u662f\u5076\u6570\u8fd8\u662f\u5947\u6570<\/h3>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\nbool esPar(int numero) {\r\n    return numero % 2 == 0;\r\n}\r\n\r\nint main() {\r\n    int numero;\r\n    cout &lt;&lt; &quot;qing shu ru yi ge shu: &quot;; cin &gt;&gt; numero;\r\n\r\n    if (esPar(numero)) {\r\n        cout &lt;&lt; &quot;zhe ge shu shi ou shu.&quot; &lt;&lt; endl;\r\n    } else {\r\n        cout &lt;&lt; &quot;zhe ge shu shi ji shu.&quot; &lt;&lt; endl;\r\n    }\r\n\r\n    return 0;\r\n}\r\n<\/pre>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u51fd\u6570 <code>esPar()<\/code> \u8fd4\u56de <code>true<\/code>\uff08\u5982\u679c\u8f93\u5165\u7684\u6570\u662f\u5076\u6570\uff09\u6216 <code>false<\/code>\uff08\u5982\u679c\u8f93\u5165\u7684\u6570\u662f\u5947\u6570\uff09\u3002<code>main()<\/code> \u4f7f\u7528\u8be5\u8fd4\u56de\u503c\u6765\u51b3\u5b9a\u8f93\u51fa\u4e0d\u540c\u7684\u6d88\u606f\u3002<\/p>\n<\/section>\n<p><center><iframe class=\"lazyload\" width=\"560\" height=\"315\" data-src=\"https:\/\/www.youtube.com\/embed\/cRi0T1AeVaA?si=zIcuFhfy5Xs9U_kn\" title=\"YouTube \u89c6\u9891\u64ad\u653e\u5668\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/center><\/p>\n<section><a name=\"5\"><\/a><\/p>\n<h2>\u9012\u5f52\uff1a\u8c03\u7528\u81ea\u8eab\u7684\u51fd\u6570<\/h2>\n<p><strong>\u9012\u5f52<\/strong> \u662f\u4e00\u79cd\u6280\u672f\uff0c\u5176\u4e2d\u51fd\u6570\u8c03\u7528\u81ea\u8eab\u4ee5\u89e3\u51b3\u95ee\u9898\uff0c\u5c06\u95ee\u9898\u62c6\u5206\u4e3a\u66f4\u5c0f\u7684\u7248\u672c\u3002\u8fd9\u5728\u8ba1\u7b97\u9636\u4e58\u3001\u6590\u6ce2\u90a3\u5951\u6570\u5217\u4ee5\u53ca\u904d\u5386\u6811\u7b49\u6570\u636e\u7ed3\u6784\u7684\u7b97\u6cd5\u4e2d\u7279\u522b\u6709\u7528\u3002<\/p>\n<h3>\u793a\u4f8b\uff1a\u8ba1\u7b97\u4e00\u4e2a\u6570\u7684\u9636\u4e58<\/h3>\n<p>\u4e00\u4e2a\u6570\u7684\u9636\u4e58 <span class=\"katex-eq\" data-katex-display=\"false\">n<\/span> \u8ba1\u7b97\u5982\u4e0b\uff1a<span class=\"katex-eq\" data-katex-display=\"false\">n!=n\\cdot(n-1)\\cdot(n-2) \\cdots 3 \\cdot2 \\cdot 1<\/span>\u3002\u8fd9\u79cd\u5b9a\u4e49\u672c\u8eab\u5c31\u5177\u6709\u9012\u5f52\u7279\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u6570\u5b66\u516c\u5f0f\u8868\u793a\u5982\u4e0b\uff1a<\/p>\n<p style=\"text-align:center;\"><span class=\"katex-eq\" data-katex-display=\"false\">\n\\begin{array}{rl}\n\n0! &amp;=1\\\\\n\nn! &amp;= n\\cdot(n-1)!\\\\\n\n\\end{array}\n\n<\/span>\n<p>\u57fa\u4e8e\u8fd9\u4e2a\u6570\u5b66\u5b9a\u4e49\uff0c\u6211\u4eec\u53ef\u4ee5\u7528C++\u7f16\u5199\u5982\u4e0b\u9012\u5f52\u51fd\u6570\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n \r\nint factorial(int n) {\r\n    if (n == 0 || n == 1) {\r\n        return 1;\r\n    }\r\n    return n*factorial(n - 1);\r\n}\r\n \r\nint main() {\r\n    int numero;\r\n    cout &lt;&lt; &quot;qing shu ru yi ge shu: &quot;; cin &gt;&gt; numero;\r\n    cout &lt;&lt; &quot;jie cheng de &quot; &lt;&lt; numero &lt;&lt; &quot; shi &quot; &lt;&lt; factorial(numero) &lt;&lt; endl;\r\n    return 0;\r\n}\r\n<\/pre>\n<p>\u5728\u6b64\u4ee3\u7801\u4e2d\uff1a<\/p>\n<ul>\n<li>\u51fd\u6570 <code>factorial(n)<\/code> \u8c03\u7528\u81ea\u8eab\uff0c\u4f20\u5165 <code>n-1<\/code>\uff0c\u76f4\u5230\u8fbe\u5230\u57fa\u51c6\u60c5\u51b5\uff08<code>n == 0<\/code> \u6216 <code>n == 1<\/code>\uff09\u3002<\/li>\n<li>\u8be5\u51fd\u6570\u901a\u8fc7\u9012\u5f52\u65b9\u5f0f\u8ba1\u7b97\uff0c\u5c06\u6240\u6709\u503c\u76f8\u4e58\uff0c\u6700\u7ec8\u83b7\u5f97\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<h3>\u793a\u4f8b\uff1a\u6590\u6ce2\u90a3\u5951\u6570\u5217<\/h3>\n<p>\u6590\u6ce2\u90a3\u5951\u6570\u5217\u662f\u4e00\u4e2a\u9012\u589e\u5e8f\u5217\uff1a<span class=\"katex-eq\" data-katex-display=\"false\">1, 1, 2, 3, 5, 8, 13, \\cdots<\/span>\u3002\u8be5\u5e8f\u5217\u7684\u7279\u70b9\u662f\u6bcf\u4e2a\u6570\u7b49\u4e8e\u524d\u4e24\u4e2a\u6570\u4e4b\u548c\u3002<\/p>\n<p>\u5982\u679c\u7528 <span class=\"katex-eq\" data-katex-display=\"false\">fibo(n)<\/span> \u8868\u793a\u6590\u6ce2\u90a3\u5951\u51fd\u6570\uff0c\u5219\u53ef\u4ee5\u7528\u4ee5\u4e0b\u9012\u5f52\u6570\u5b66\u5b9a\u4e49\uff1a<\/p>\n<p style=\"text-align:center;\"><span class=\"katex-eq\" data-katex-display=\"false\">\n\\begin{array}{rl}\n\nfibo(0) &amp;= 1\\\\\n\nfibo(1) &amp;= 1 \\\\\n\nfibo(n) &amp;= fibo(n-1) + fibo(n-2)\n\n\\end{array}\n\n<\/span>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2aC++\u7a0b\u5e8f\uff0c\u7528\u9012\u5f52\u65b9\u5f0f\u8ba1\u7b97\u6590\u6ce2\u90a3\u5951\u6570\u5217\uff1a<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include&lt;iostream&gt;\r\n \r\nusing namespace std;\r\n \r\nint fibo(int numero){\r\n    if (numero==0||numero==1){\r\n        return 1;\r\n    }\r\n    return fibo(numero-1)+fibo(numero-2);\r\n}\r\n \r\nint main(){\r\n    int x=0, i=0;\r\n    cout &lt;&lt; &quot;qing shu ru yi ge shu: &quot;; cin &gt;&gt; x;\r\n     \r\n    while (i &lt; x){\r\n        cout &lt;&lt;&quot;di &quot; &lt;&lt; i+1 &lt;&lt; &quot; ge wei zhi de fei bo na qi shu shi: &quot; &lt;&lt; fibo(i)&lt;&lt;endl;\r\n        i=i+1;\r\n    }   \r\n}\r\n<\/pre>\n<\/section>\n<p><center><iframe class=\"lazyload\" width=\"560\" height=\"315\" data-src=\"https:\/\/www.youtube.com\/embed\/EnMxDCHV1qg?si=4Y6oVAdNe9UeVDL5\" title=\"YouTube \u89c6\u9891\u64ad\u653e\u5668\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/center><\/p>\n<section><a name=\"6\"><\/a><\/p>\n<h2>\u51fd\u6570\u7684\u591a\u91cd\u8fd4\u56de\u503c<\/h2>\n<p>\u5728C++\u4e2d\uff0c\u51fd\u6570\u53ef\u4ee5\u4f7f\u7528<code>std::pair<\/code>\u3001<code>std::tuple<\/code> \u6216\u53d8\u91cf\u5f15\u7528\u6765\u8fd4\u56de\u591a\u4e2a\u503c\u3002<\/p>\n<h3>\u793a\u4f8b\uff1a\u4f7f\u7528 <code>std::pair<\/code> \u8fd4\u56de\u4e24\u4e2a\u503c<\/h3>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\n#include &lt;utility&gt; \/\/ shi yong std::pair\r\nusing namespace std;\r\n \r\npair&lt;int, int&gt; dividir(int a, int b) {\r\n    return make_pair(a \/ b, a % b);\r\n}\r\n \r\nint main() {\r\n    int numerador=0, denominador=1;\r\n     \r\n    cout &lt;&lt; &quot;qing shu ru chu zi: &quot;; cin &gt;&gt; numerador;\r\n    cout &lt;&lt; &quot;qing shu ru mu zi: &quot;; cin &gt;&gt; denominador;\r\n     \r\n    pair&lt;int, int&gt; resultado = dividir(numerador, denominador);\r\n \r\n    cout &lt;&lt; &quot;shang: &quot; &lt;&lt; resultado.first &lt;&lt; endl;\r\n    cout &lt;&lt; &quot;yu shu: &quot; &lt;&lt; resultado.second &lt;&lt; endl;\r\n \r\n    return 0;\r\n}\r\n<\/pre>\n<p>\u5728\u8fd9\u91cc\uff0c\u51fd\u6570<code>dividir()<\/code> \u8fd4\u56de\u4e24\u4e2a\u503c\uff1a\u6574\u6570\u9664\u6cd5\u7684\u5546\u548c\u4f59\u6570\u3002<\/p>\n<h3>\u793a\u4f8b\uff1a\u4f7f\u7528 <code>std::tuple<\/code> \u8fd4\u56de\u591a\u4e2a\u503c<\/h3>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\n#include &lt;tuple&gt;\r\nusing namespace std;\r\n\r\ntuple&lt;int, int, int&gt; operaciones(int a, int b) {\r\n    return make_tuple(a + b, a - b, a * b);\r\n}\r\n\r\nint main() {\r\n    int suma=0, resta=0, producto=0;\r\n    int a=0, b=0;\r\n    \r\n    cout &lt;&lt; &quot;qing shu ru yi ge shu: &quot;; cin &gt;&gt; a;\r\n    \r\n    cout &lt;&lt; &quot;qing zai shu ru yi ge shu: &quot;; cin &gt;&gt; b;\r\n    \r\n    std::tie(suma, resta, producto) = operaciones(a, b);\r\n\r\n    cout &lt;&lt; &quot;jia fa: &quot; &lt;&lt; suma &lt;&lt; &quot;, jian fa: &quot; &lt;&lt; resta &lt;&lt; &quot;, cheng fa: &quot; &lt;&lt; producto &lt;&lt; endl;\r\n    return 0;\r\n}\r\n<\/pre>\n<\/section>\n<p><center><iframe class=\"lazyload\" width=\"560\" height=\"315\" data-src=\"https:\/\/www.youtube.com\/embed\/UdkBf26gTew?si=RTadJpxFBQ2Uctzs\" title=\"YouTube \u89c6\u9891\u64ad\u653e\u5668\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/center><\/p>\n<section><a name=\"7\"><\/a><\/p>\n<h2>\u51fd\u6570\u91cd\u8f7d\uff08overloading\uff09<\/h2>\n<p>\u51fd\u6570\u91cd\u8f7d\u5141\u8bb8\u5b9a\u4e49\u591a\u4e2a\u540c\u540d\u51fd\u6570\uff0c\u4f46\u53c2\u6570\u7684\u7c7b\u578b\u6216\u6570\u91cf\u4e0d\u540c\u3002\u8fd9\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u91cd\u7528\u6027\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\n#include &lt;string&gt; \/\/ shi yong std::string\r\n#include &lt;cmath&gt;\r\n\r\nusing namespace std;\r\n\r\n\/\/ zheng fang xing huo yuan quan de mian ji (yi ge shu ju)\r\ndouble area(double lado) {\r\n    return lado * lado;\r\n}\r\n\r\n\/\/ ju xing de mian ji (liang ge shu ju)\r\ndouble area(double base, double altura) {\r\n    return base * altura;\r\n}\r\n\r\n\/\/ san jiao xing de mian ji (san ge shu ju)\r\ndouble area(double a, double b, double c){\r\n    return 0.25*sqrt((a+b+c)*(a+b-c)*(a-b+c)*(-a+b+c));\r\n}\r\n\r\nint main() {\r\n    string figura;\r\n    double resultado = 0;\r\n    double l1=0, l2=0, l3=0;\r\n\r\n    \/\/ wen ti xing zhuang\r\n    cout &lt;&lt; &quot;qing shu ru xing zhuang? (zhengfangxing, yuanquan, juxing huo sanjiaoxing): &quot;;\r\n    cin &gt;&gt; figura;\r\n\r\n    \/\/ pan duan xing zhuang\r\n    if (figura == &quot;zhengfangxing&quot;) {\r\n        cout &lt;&lt; &quot;bian chang shi duo shao? &quot;; cin &gt;&gt; l1;\r\n        resultado = area(l1);\r\n        cout &lt;&lt; &quot;zheng fang xing de mian ji shi: &quot; &lt;&lt; resultado &lt;&lt; endl;\r\n    } \r\n    else if (figura == &quot;juxing&quot;){\r\n        cout &lt;&lt; &quot;ji shu ru di bian: &quot;; cin &gt;&gt; l1;\r\n        cout &lt;&lt; &quot;ji shu ru gao: &quot;; cin &gt;&gt; l2;\r\n        resultado = area(l1, l2);\r\n        cout &lt;&lt; &quot;ju xing de mian ji shi: &quot; &lt;&lt; resultado &lt;&lt; endl;\r\n    } \r\n    else if (figura == &quot;yuanquan&quot;) {\r\n        l1 = 3.141592653;\r\n        cout &lt;&lt; &quot;shu ru ban jing: &quot;; cin &gt;&gt; l2;\r\n        resultado = area(l1, l2);\r\n        cout &lt;&lt; &quot;yuan quan de mian ji shi: &quot; &lt;&lt; resultado &lt;&lt; endl;\r\n    } \r\n    else if (figura == &quot;sanjiaoxing&quot;){\r\n        cout &lt;&lt; &quot;shu ru san ge bian chang:&quot; &lt;&lt; endl;\r\n        cout &lt;&lt; &quot;bian 1: &quot;; cin &gt;&gt; l1;\r\n        cout &lt;&lt; &quot;bian 2: &quot;; cin &gt;&gt; l2;\r\n        cout &lt;&lt; &quot;bian 3: &quot;; cin &gt;&gt; l3;\r\n\r\n        if ((l1+l2+l3)*(l1+l2-l3)*(l1-l2+l3)*(-l1+l2+l3)&lt;0){\r\n            cout &lt;&lt; &quot;zhe ge san jiao xing wu fa shi xian&quot;;\r\n        }    \r\n        else {\r\n            resultado = area(l1,l2,l3);\r\n            cout &lt;&lt; &quot;san jiao xing de mian ji shi: &quot; &lt;&lt; resultado &lt;&lt; endl;\r\n        }             \r\n    }\r\n    else {\r\n        cout &lt;&lt; &quot;bu he fa de xing zhuang.&quot; &lt;&lt; endl;\r\n    }\r\n    return 0;\r\n}\r\n<\/pre>\n<\/section>\n<p><center><iframe class=\"lazyload\" width=\"560\" height=\"315\" data-src=\"https:\/\/www.youtube.com\/embed\/0vzQFAXjqbg?si=ckRolBE3n0I5QPPp\" title=\"YouTube \u89c6\u9891\u64ad\u653e\u5668\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/center><\/p>\n<section><a name=\"8\"><\/a><\/p>\n<h2>C++\u4e2d\u7684\u5185\u8054\u51fd\u6570\uff08inline functions\uff09<\/h2>\n<p>C++\u4e2d\u7684<code>inline<\/code>\u51fd\u6570\u63d0\u4f9b\u4e86\u4e00\u79cd\u4f18\u5316\u7a0b\u5e8f\u6027\u80fd\u7684\u673a\u5236\uff0c\u51cf\u5c11\u4e86\u51fd\u6570\u8c03\u7528\u7684\u5f00\u9500\u3002\u4e0e\u4f20\u7edf\u7684\u51fd\u6570\u8c03\u7528\u4e0d\u540c\uff0c\u7f16\u8bd1\u5668\u4f1a\u5c1d\u8bd5\u5728\u8c03\u7528\u7684\u5730\u65b9\u76f4\u63a5\u5c55\u5f00\u51fd\u6570\u4ee3\u7801\uff0c\u800c\u4e0d\u662f\u8df3\u8f6c\u5230\u51fd\u6570\u7684\u5b58\u50a8\u4f4d\u7f6e\u6267\u884c\u3002<\/p>\n<h3>\u5185\u8054\u51fd\u6570\u7684\u8bed\u6cd5<\/h3>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ninline fan_hui_lei_xing han_shu_ming(can_shu_lie_biao) {\r\n    \/\/ han_shu_ti\r\n    return zhi; \/\/ ru_guo_xu_yao\r\n}\r\n<\/pre>\n<p>\u4f7f\u7528<code>inline<\/code>\u540e\uff0c\u7a0b\u5e8f\u4e0d\u9700\u8981\u8df3\u8f6c\u5230\u53e6\u4e00\u4e2a\u5185\u5b58\u5730\u5740\u6267\u884c\u51fd\u6570\uff0c\u4ece\u800c\u51cf\u5c11\u6267\u884c\u65f6\u95f4\u3002<\/p>\n<h3>\u5185\u8054\u51fd\u6570 vs \u4f20\u7edf\u51fd\u6570<\/h3>\n<table>\n<tr>\n<th style=\"width: 20%;\"><strong>\u7279\u6027<\/strong><\/th>\n<th><strong>\u4f20\u7edf\u51fd\u6570<\/strong><\/th>\n<th><strong>\u5185\u8054\u51fd\u6570<\/strong><\/th>\n<\/tr>\n<tr>\n<td><strong>\u51fd\u6570\u8c03\u7528<\/strong><\/td>\n<td>\u7a0b\u5e8f\u6267\u884c\u65f6\u9700\u8981\u8df3\u8f6c\u5230\u51fd\u6570\u5730\u5740\u3002<\/td>\n<td>\u7f16\u8bd1\u5668\u76f4\u63a5\u5c06\u51fd\u6570\u4ee3\u7801\u63d2\u5165\u8c03\u7528\u5904\u3002<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8fd0\u884c\u65f6\u95f4<\/strong><\/td>\n<td>\u7531\u4e8e\u8c03\u7528\u5f00\u9500\uff0c\u53ef\u80fd\u7a0d\u6162\u3002<\/td>\n<td>\u5bf9\u4e8e\u5c0f\u578b\u51fd\u6570\uff0c\u53ef\u4ee5\u52a0\u5feb\u6267\u884c\u901f\u5ea6\u3002<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5185\u5b58\u4f7f\u7528<\/strong><\/td>\n<td>\u51fd\u6570\u4ee3\u7801\u4ec5\u5b58\u50a8\u4e00\u6b21\u3002<\/td>\n<td>\u5982\u679c\u4f7f\u7528\u8fc7\u591a\uff0c\u4f1a\u5bfc\u81f4\u53ef\u6267\u884c\u6587\u4ef6\u53d8\u5927\u3002<\/td>\n<\/tr>\n<\/table>\n<h3>\u5185\u8054\u51fd\u6570\u793a\u4f8b<\/h3>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\ninline int cuadrado(int x) {\r\n    return x * x;\r\n}\r\n\r\nint main() {\r\n    cout &lt;&lt; &quot;shu zi 5 de ping fang shi: &quot; &lt;&lt; cuadrado(5) &lt;&lt; endl;\r\n    return 0;\r\n}\r\n<\/pre>\n<p><strong>\ud83d\udd0d \u7f16\u8bd1\u5668\u6267\u884c\u8fc7\u7a0b\uff1a<\/strong><\/p>\n<ol>\n<li>\u7f16\u8bd1\u5668\u7528 <code>5 * 5<\/code> \u76f4\u63a5\u66ff\u6362 <code>cuadrado(5)<\/code>\u3002<\/li>\n<li>\u4e0d\u9700\u8981\u51fd\u6570\u8c03\u7528\u8df3\u8f6c\u3002<\/li>\n<li>\u8ba1\u7b97\u5728\u8c03\u7528\u4f4d\u7f6e\u76f4\u63a5\u5b8c\u6210\uff0c\u63d0\u9ad8\u6027\u80fd\u3002<\/li>\n<\/ol>\n<h3><code>inline<\/code> \u7684\u4f18\u7f3a\u70b9<\/h3>\n<p><strong>\u2705 \u4f18\u52bf<\/strong><\/p>\n<ul>\n<li><strong>\u6d88\u9664\u51fd\u6570\u8c03\u7528\u5f00\u9500\uff1a<\/strong> \u5728\u5c0f\u578b\u51fd\u6570\u548c\u9891\u7e41\u8c03\u7528\u7684\u51fd\u6570\u4e2d\u51cf\u5c11\u6267\u884c\u65f6\u95f4\u3002<\/li>\n<li><strong>\u7f16\u8bd1\u5668\u53ef\u8fdb\u884c\u4f18\u5316\uff1a<\/strong> \u907f\u514d\u4f7f\u7528CPU\u5bc4\u5b58\u5668\u548c\u6808\uff0c\u63d0\u9ad8\u6548\u7387\u3002<\/li>\n<li><strong>\u4fdd\u8bc1\u51fd\u6570\u4ee3\u7801\u5728\u7f16\u8bd1\u671f\u53ef\u7528\u3002<\/strong><\/li>\n<\/ul>\n<p><strong>\u274c \u52a3\u52bf<\/strong><\/p>\n<ul>\n<li><strong>\u53ef\u80fd\u589e\u52a0\u4e8c\u8fdb\u5236\u6587\u4ef6\u5927\u5c0f\uff1a<\/strong> \u5982\u679c <code>inline<\/code> \u51fd\u6570\u5728\u7a0b\u5e8f\u4e2d\u88ab\u591a\u6b21\u8c03\u7528\uff0c\u4ee3\u7801\u4f1a\u5728\u591a\u4e2a\u5730\u65b9\u5c55\u5f00\uff0c\u5bfc\u81f4\u53ef\u6267\u884c\u6587\u4ef6\u589e\u5927\u3002<\/li>\n<li><strong>\u7f16\u8bd1\u5668\u53ef\u80fd\u4f1a\u5ffd\u7565 <code>inline<\/code> \u8bf7\u6c42\uff1a<\/strong> \u5f53\u7f16\u8bd1\u5668\u8ba4\u4e3a\u51fd\u6570\u592a\u5927\u6216\u4e0d\u9002\u5408\u5185\u8054\u5c55\u5f00\u65f6\uff0c\u53ef\u80fd\u4f1a\u5ffd\u7565 <code>inline<\/code> \u4fee\u9970\u7b26\u3002<\/li>\n<\/ul>\n<\/section>\n<footer><a name=\"9\"><\/a><\/p>\n<h2>\u5173\u4e8eC++\u51fd\u6570\u7684\u6700\u7ec8\u601d\u8003<\/h2>\n<p>C++\u4e2d\u7684\u51fd\u6570\u662f\u7f16\u5199\u6a21\u5757\u5316\u3001\u53ef\u590d\u7528\u4e14\u6613\u7ef4\u62a4\u4ee3\u7801\u7684\u91cd\u8981\u5de5\u5177\u3002\u5728\u672c\u8bfe\u7a0b\u4e2d\uff0c\u6211\u4eec\u4ece\u51fd\u6570\u7684\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u7b49\u57fa\u7840\u77e5\u8bc6\u51fa\u53d1\uff0c\u9010\u6b65\u5b66\u4e60\u4e86\u66f4\u9ad8\u7ea7\u7684\u6280\u672f\uff0c\u5982\u8fd4\u56de\u503c\u4f20\u9012\u3001\u9012\u5f52\u3001\u51fd\u6570\u91cd\u8f7d\u4ee5\u53ca<code>inline<\/code>\u51fd\u6570\u7684\u4f18\u5316\u7b56\u7565\u3002\u540c\u65f6\uff0c\u6211\u4eec\u6bd4\u8f83\u4e86\u4e0d\u540c\u7684\u4ee3\u7801\u7ec4\u7ec7\u7b56\u7565\uff0c\u5e76\u63a2\u8ba8\u4e86\u5982\u4f55\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u6700\u4f73\u65b9\u6848\u3002<\/p>\n<p>\u6b63\u786e\u7406\u89e3\u5e76\u5e94\u7528\u51fd\u6570\u4e0d\u4ec5\u80fd\u8ba9\u4f60\u7684\u4ee3\u7801\u66f4\u52a0\u6e05\u6670\u548c\u9ad8\u6548\uff0c\u8fd8\u80fd\u5e2e\u52a9\u4f60\u89e3\u51b3\u66f4\u590d\u6742\u7684\u95ee\u9898\uff0c\u4f7f\u7a0b\u5e8f\u7ed3\u6784\u66f4\u52a0\u5408\u7406\u3002\u73b0\u5728\uff0c\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86\u5728C++\u4e2d\u7f16\u5199\u4e13\u4e1a\u3001\u53ef\u6269\u5c55\u7a0b\u5e8f\u7684\u57fa\u7840\u77e5\u8bc6\u3002\u5de9\u56fa\u8fd9\u4e9b\u77e5\u8bc6\u7684\u6700\u4f73\u65b9\u5f0f\u662f\u5b9e\u8df5\uff0c\u6240\u4ee5\u8bf7\u5c1d\u8bd5\u7f16\u5199\u66f4\u591a\u4e0d\u540c\u7c7b\u578b\u7684\u51fd\u6570\uff0c\u5e76\u5728\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u52a0\u4ee5\u5e94\u7528\u3002\u7ee7\u7eed\u63a2\u7d22C++\u7684\u4e16\u754c\uff0c\u8ba9\u4f60\u7684\u7f16\u7a0b\u80fd\u529b\u66f4\u4e0a\u4e00\u5c42\u697c\uff01<\/p>\n<\/footer>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++\u4e2d\u7684\u51fd\u6570 C++\u4e2d\u7684\u51fd\u6570\uff1a\u7f16\u5199\u6e05\u6670\u4e14\u53ef\u590d\u7528\u4ee3\u7801\u7684\u5173\u952e \u4f60\u662f\u5426\u6ce8\u610f\u5230\uff0c\u968f\u7740\u7a0b\u5e8f\u89c4\u6a21\u7684\u589e\u957f\uff0c\u4ee3\u7801\u53d8\u5f97\u8d8a\u6765\u8d8a\u96be\u4ee5\u7406\u89e3\u548c\u7ef4\u62a4\uff1f\u5982\u679c\u4f60\u66fe\u7ecf\u89c9\u5f97\u81ea\u5df1\u7684\u4ee3\u7801\u50cf\u4e00\u4e2a\u590d\u6742\u7684\u8ff7\u5bab\uff0c\u90a3\u53ef\u80fd\u662f\u56e0\u4e3a\u4f60\u8fd8\u6ca1\u6709\u5145\u5206\u5229\u7528C++\u7684\u51fd\u6570\u3002\u51fd\u6570\u5c31\u50cf\u6784\u9020\u6a21\u5757\uff0c\u5141\u8bb8\u5c06\u7a0b\u5e8f\u5212\u5206\u4e3a\u53ef\u7ba1\u7406\u7684\u90e8\u5206\uff0c\u4f7f\u4ee3\u7801\u66f4\u6613\u8bfb\u3001\u66f4\u6613\u7ef4\u62a4\uff0c\u5e76\u4e14\u66f4\u4f18\u5316\u3002\u5728\u672c\u8bfe\u7a0b\u4e2d\uff0c\u4f60\u5c06\u5b66\u4e60\u5982\u4f55\u6709\u6548\u5730\u4f7f\u7528\u51fd\u6570\uff0c\u4ee5\u6539\u5584\u4ee3\u7801\u7684\u7ec4\u7ec7\u7ed3\u6784\uff0c\u7f16\u5199\u66f4\u7ed3\u6784\u5316\u7684\u7a0b\u5e8f\uff0c\u5e76\u4f7f\u4f60\u7684C++\u5f00\u53d1\u66f4\u52a0\u4e13\u4e1a\u548c\u9ad8\u6548\u3002 \u5b66\u4e60\u76ee\u6807 \u5b8c\u6210\u672c\u8bfe\u7a0b\u540e\uff0c\u4f60\u5c06\u5b66\u4f1a\uff1a \u7406\u89e3 \u51fd\u6570\u7684\u76ee\u7684\u4ee5\u53ca\u5b83\u4eec\u5728C++\u4e2d\u7684\u91cd\u8981\u6027\u3002 \u521b\u5efa \u6b63\u786e\u7684\u51fd\u6570\uff0c\u786e\u4fdd\u4ee3\u7801\u7ed3\u6784\u6e05\u6670\u3002 \u8c03\u7528 \u51fd\u6570\u5e76\u7406\u89e3\u5b83\u4eec\u7684\u6267\u884c\u65b9\u5f0f\u3002 \u533a\u5206 \u8fd4\u56de\u503c\u51fd\u6570\u4e0e\u4ec5\u6267\u884c\u6307\u4ee4\u7684\u51fd\u6570\u3002 \u6bd4\u8f83 \u4e0d\u540c\u7684\u51fd\u6570\u5b9a\u4e49\u65b9\u5f0f\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9009\u62e9\u6700\u4f73\u65b9\u6848\u3002 \u76ee\u5f55 \u51fd\u6570\u7684\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49 \u65b9\u6cd5\u4e00\uff1a\u5148\u58f0\u660e &#8211; \u8c03\u7528 &#8211; \u5b9a\u4e49 \u65b9\u6cd5\u4e8c\uff1a\u58f0\u660e\u540e\u5148\u5b9e\u73b0\u518d\u8c03\u7528 \u8fd4\u56de\u503c\u7684\u4f20\u9012 \u9012\u5f52\uff1a\u8c03\u7528\u81ea\u8eab\u7684\u51fd\u6570 \u51fd\u6570\u7684\u591a\u8fd4\u56de\u503c \u51fd\u6570\u91cd\u8f7d\uff08overloading\uff09 C++\u4e2d\u7684\u5185\u8054\u51fd\u6570\uff08inline functions\uff09 \u5173\u4e8eC++\u51fd\u6570\u7684\u6700\u7ec8\u601d\u8003 \u51fd\u6570\u7684\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49 \u5728C++\u4e2d\uff0c\u51fd\u6570\u662f\u53ef\u91cd\u590d\u4f7f\u7528\u7684\u4ee3\u7801\u5757\uff0c\u4f7f\u7a0b\u5e8f\u7ed3\u6784\u66f4\u52a0\u6a21\u5757\u5316\u548c\u6709\u7ec4\u7ec7\u3002\u6bcf\u4e2a\u51fd\u6570\u5c01\u88c5\u4e00\u4e2a\u7279\u5b9a\u7684\u4efb\u52a1\uff0c\u6709\u52a9\u4e8e\u63d0\u9ad8\u4ee3\u7801\u7684\u6e05\u6670\u5ea6\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u8981\u5728\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u51fd\u6570\uff0c\u6211\u4eec\u9700\u8981\u9075\u5faa\u4e09\u4e2a\u57fa\u672c\u6b65\u9aa4\uff1a\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u3002 \u8fd9\u4e09\u4e2a\u6982\u5ff5\u81f3\u5173\u91cd\u8981\uff0c\u6bcf\u4e2a\u6982\u5ff5\u5728\u4ee3\u7801\u7ed3\u6784\u4e2d\u90fd\u626e\u6f14\u7740\u7279\u5b9a\u7684\u89d2\u8272\u3002\u8ba9\u6211\u4eec\u8be6\u7ec6\u4e86\u89e3\u6bcf\u4e2a\u90e8\u5206\u3002 \u51fd\u6570\u7684\u58f0\u660e \u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u51fd\u6570\u4e4b\u524d\uff0c\u7f16\u8bd1\u5668\u5fc5\u987b\u77e5\u9053\u5b83\u7684\u5b58\u5728\u3002\u8fd9\u662f\u901a\u8fc7\u51fd\u6570\u58f0\u660e\u6216\u51fd\u6570\u539f\u578b\u5b9e\u73b0\u7684\u3002 \u51fd\u6570\u58f0\u660e\u5411\u7f16\u8bd1\u5668\u63d0\u4f9b\u4e09\u4e2a\u5173\u952e\u4fe1\u606f\uff1a \u51fd\u6570\u8fd4\u56de\u7684\u6570\u636e\u7c7b\u578b\uff08\u5982\u679c\u6ca1\u6709\u8fd4\u56de\u503c\uff0c\u5219\u4f7f\u7528void\uff09\u3002 \u51fd\u6570\u7684\u540d\u79f0\u3002 \u51fd\u6570\u7684\u53c2\u6570\u5217\u8868\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u6570\u636e\u7c7b\u578b\u3002 \u51fd\u6570\u58f0\u660e\u7684\u4e00\u822c\u8bed\u6cd5\u5982\u4e0b\uff1a fan_hui_lei_xing han_shu_ming (can_shu_lie_biao); \u901a\u5e38\uff0c\u51fd\u6570\u58f0\u660e\u653e\u5728main()\u4e4b\u524d\uff0c\u6216\u8005\u5728\u591a\u6587\u4ef6\u7a0b\u5e8f\u4e2d\u653e\u5165\u5934\u6587\u4ef6\uff08.h\uff09\u3002 \u51fd\u6570\u7684\u8c03\u7528 \u58f0\u660e\u51fd\u6570\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8c03\u7528\u5b83\uff0c\u4f7f\u5176\u6267\u884c\u5b9a\u4e49\u7684\u529f\u80fd\u3002 \u8c03\u7528\u51fd\u6570\u65f6\uff1a \u6267\u884c\u5176\u5b9a\u4e49\u4e2d\u5305\u542b\u7684\u4ee3\u7801\u3002 \u5982\u679c\u51fd\u6570\u6709\u8fd4\u56de\u503c\uff0c\u8be5\u503c\u53ef\u4ee5\u5b58\u50a8\u5728\u53d8\u91cf\u4e2d\u6216\u76f4\u63a5\u7528\u4e8e\u8868\u8fbe\u5f0f\u3002 \u5982\u679c\u51fd\u6570\u662fvoid\u7c7b\u578b\uff0c\u5b83\u53ea\u6267\u884c\u6307\u4ee4\uff0c\u4e0d\u8fd4\u56de\u4efb\u4f55\u503c\u3002 \u51fd\u6570\u8c03\u7528\u7684\u8bed\u6cd5\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u5199\u51fa\u51fd\u6570\u540d\uff0c\u5e76\u5728\u62ec\u53f7\u5185\u63d0\u4f9b\u53c2\u6570\uff08\u5982\u679c\u9700\u8981\uff09\uff1a han_shu_ming(can_shu); \u51fd\u6570\u7684\u5b9a\u4e49 \u51fd\u6570\u5b9a\u4e49\u662f\u5b9e\u73b0\u5176\u529f\u80fd\u7684\u5730\u65b9\u3002\u8fd9\u91cc\u6307\u5b9a\u4e86\u5728\u8c03\u7528\u51fd\u6570\u65f6\u6267\u884c\u7684\u6307\u4ee4\u3002 \u51fd\u6570\u5b9a\u4e49\u7684\u4e00\u822c\u8bed\u6cd5\u5982\u4e0b\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":31365,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2,"footnotes":""},"categories":[997,979],"tags":[],"class_list":["post-31437","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","category-979"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++\u4e2d\u7684\u51fd\u6570 - toposuranos.com\/material<\/title>\n<meta name=\"description\" content=\"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/toposuranos.com\/material\/zh\/c\u4e2d\u7684\u51fd\u6570\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++\u4e2d\u7684\u51fd\u6570\" \/>\n<meta property=\"og:description\" content=\"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002\" \/>\n<meta property=\"og:url\" content=\"http:\/\/toposuranos.com\/material\/zh\/c\u4e2d\u7684\u51fd\u6570\/\" \/>\n<meta property=\"og:site_name\" content=\"toposuranos.com\/material\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/groups\/toposuranos\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-04T10:07:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T19:31:14+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c-1024x585.jpg\" \/>\n<meta name=\"author\" content=\"giorgio.reveco\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"C++\u4e2d\u7684\u51fd\u6570\" \/>\n<meta name=\"twitter:description\" content=\"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002\" \/>\n<meta name=\"twitter:image\" content=\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@topuranos\" \/>\n<meta name=\"twitter:site\" content=\"@topuranos\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"giorgio.reveco\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/\"},\"author\":{\"name\":\"giorgio.reveco\",\"@id\":\"http:\/\/toposuranos.com\/material\/#\/schema\/person\/e15164361c3f9a2a02cf6c234cf7fdc1\"},\"headline\":\"C++\u4e2d\u7684\u51fd\u6570\",\"datePublished\":\"2025-02-04T10:07:03+00:00\",\"dateModified\":\"2025-02-07T19:31:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/\"},\"wordCount\":1579,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/toposuranos.com\/material\/#organization\"},\"image\":{\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg\",\"articleSection\":[\"C++\u7f16\u7a0b\",\"\u8ba1\u7b97\u4e0e\u4fe1\u606f\u5b66\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/\",\"url\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/\",\"name\":\"C++\u4e2d\u7684\u51fd\u6570 - toposuranos.com\/material\",\"isPartOf\":{\"@id\":\"http:\/\/toposuranos.com\/material\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg\",\"datePublished\":\"2025-02-04T10:07:03+00:00\",\"dateModified\":\"2025-02-07T19:31:14+00:00\",\"description\":\"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002\",\"breadcrumb\":{\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage\",\"url\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg\",\"contentUrl\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg\",\"width\":1792,\"height\":1024,\"caption\":\"toposuranos.com\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/toposuranos.com\/material\/es\/cursos-de-matematica-y-fisica\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++\u4e2d\u7684\u51fd\u6570\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/toposuranos.com\/material\/#website\",\"url\":\"http:\/\/toposuranos.com\/material\/\",\"name\":\"toposuranos.com\/material\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/toposuranos.com\/material\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/toposuranos.com\/material\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/toposuranos.com\/material\/#organization\",\"name\":\"toposuranos.com\/material\",\"url\":\"http:\/\/toposuranos.com\/material\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"http:\/\/toposuranos.com\/material\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/logo.png\",\"contentUrl\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/logo.png\",\"width\":2400,\"height\":2059,\"caption\":\"toposuranos.com\/material\"},\"image\":{\"@id\":\"http:\/\/toposuranos.com\/material\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/groups\/toposuranos\",\"https:\/\/x.com\/topuranos\",\"https:\/\/www.youtube.com\/channel\/UC16yDm12cPcrwsE0fAM7X1g\",\"https:\/\/www.linkedin.com\/company\/69429190\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/toposuranos.com\/material\/#\/schema\/person\/e15164361c3f9a2a02cf6c234cf7fdc1\",\"name\":\"giorgio.reveco\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"http:\/\/toposuranos.com\/material\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/1694478625378-96x96.jpeg\",\"contentUrl\":\"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/1694478625378-96x96.jpeg\",\"caption\":\"giorgio.reveco\"},\"description\":\"Soy Licenciado en F\u00edsica, Magister en Ingenier\u00eda Industrial y Docente Universitario. Me dedico a desmitificar la f\u00edsica y las matem\u00e1ticas. Mi objetivo es hacer que estos campos sean f\u00e1cilmente comprensibles para todos, proporcionando las herramientas para explorar no solo el mundo que nos rodea, sino tambi\u00e9n las profundidades de nuestra propia existencia y el orden natural que nos conecta con el cosmos.\",\"sameAs\":[\"http:\/\/toposuranos.com\/material\"],\"url\":\"http:\/\/toposuranos.com\/material\/author\/giorgio-reveco\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++\u4e2d\u7684\u51fd\u6570 - toposuranos.com\/material","description":"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002","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":"http:\/\/toposuranos.com\/material\/zh\/c\u4e2d\u7684\u51fd\u6570\/","og_locale":"es_ES","og_type":"article","og_title":"C++\u4e2d\u7684\u51fd\u6570","og_description":"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002","og_url":"http:\/\/toposuranos.com\/material\/zh\/c\u4e2d\u7684\u51fd\u6570\/","og_site_name":"toposuranos.com\/material","article_publisher":"https:\/\/www.facebook.com\/groups\/toposuranos","article_published_time":"2025-02-04T10:07:03+00:00","article_modified_time":"2025-02-07T19:31:14+00:00","og_image":[{"url":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c-1024x585.jpg","type":"","width":"","height":""}],"author":"giorgio.reveco","twitter_card":"summary_large_image","twitter_title":"C++\u4e2d\u7684\u51fd\u6570","twitter_description":"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002","twitter_image":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg","twitter_creator":"@topuranos","twitter_site":"@topuranos","twitter_misc":{"Escrito por":"giorgio.reveco","Tiempo de lectura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#article","isPartOf":{"@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/"},"author":{"name":"giorgio.reveco","@id":"http:\/\/toposuranos.com\/material\/#\/schema\/person\/e15164361c3f9a2a02cf6c234cf7fdc1"},"headline":"C++\u4e2d\u7684\u51fd\u6570","datePublished":"2025-02-04T10:07:03+00:00","dateModified":"2025-02-07T19:31:14+00:00","mainEntityOfPage":{"@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/"},"wordCount":1579,"commentCount":0,"publisher":{"@id":"http:\/\/toposuranos.com\/material\/#organization"},"image":{"@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage"},"thumbnailUrl":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg","articleSection":["C++\u7f16\u7a0b","\u8ba1\u7b97\u4e0e\u4fe1\u606f\u5b66"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/","url":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/","name":"C++\u4e2d\u7684\u51fd\u6570 - toposuranos.com\/material","isPartOf":{"@id":"http:\/\/toposuranos.com\/material\/#website"},"primaryImageOfPage":{"@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage"},"image":{"@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage"},"thumbnailUrl":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg","datePublished":"2025-02-04T10:07:03+00:00","dateModified":"2025-02-07T19:31:14+00:00","description":"\u9ad8\u6548\u5b66\u4e60C++\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u638c\u63e1\u5982\u4f55\u58f0\u660e\u3001\u8c03\u7528\u548c\u5b9a\u4e49\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u63a2\u7d22\u8fd4\u56de\u503c\u3001\u51fd\u6570\u91cd\u8f7d\u3001\u9012\u5f52\u548c\u5185\u8054\u51fd\u6570\u7b49\u6982\u5ff5\u3002","breadcrumb":{"@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#primaryimage","url":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg","contentUrl":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2025\/02\/funciones-en-c.jpg","width":1792,"height":1024,"caption":"toposuranos.com"},{"@type":"BreadcrumbList","@id":"http:\/\/toposuranos.com\/material\/zh\/c%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/toposuranos.com\/material\/es\/cursos-de-matematica-y-fisica\/"},{"@type":"ListItem","position":2,"name":"C++\u4e2d\u7684\u51fd\u6570"}]},{"@type":"WebSite","@id":"http:\/\/toposuranos.com\/material\/#website","url":"http:\/\/toposuranos.com\/material\/","name":"toposuranos.com\/material","description":"","publisher":{"@id":"http:\/\/toposuranos.com\/material\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/toposuranos.com\/material\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"http:\/\/toposuranos.com\/material\/#organization","name":"toposuranos.com\/material","url":"http:\/\/toposuranos.com\/material\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"http:\/\/toposuranos.com\/material\/#\/schema\/logo\/image\/","url":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/logo.png","contentUrl":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/logo.png","width":2400,"height":2059,"caption":"toposuranos.com\/material"},"image":{"@id":"http:\/\/toposuranos.com\/material\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/groups\/toposuranos","https:\/\/x.com\/topuranos","https:\/\/www.youtube.com\/channel\/UC16yDm12cPcrwsE0fAM7X1g","https:\/\/www.linkedin.com\/company\/69429190"]},{"@type":"Person","@id":"http:\/\/toposuranos.com\/material\/#\/schema\/person\/e15164361c3f9a2a02cf6c234cf7fdc1","name":"giorgio.reveco","image":{"@type":"ImageObject","inLanguage":"es","@id":"http:\/\/toposuranos.com\/material\/#\/schema\/person\/image\/","url":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/1694478625378-96x96.jpeg","contentUrl":"http:\/\/toposuranos.com\/material\/wp-content\/uploads\/2023\/10\/1694478625378-96x96.jpeg","caption":"giorgio.reveco"},"description":"Soy Licenciado en F\u00edsica, Magister en Ingenier\u00eda Industrial y Docente Universitario. Me dedico a desmitificar la f\u00edsica y las matem\u00e1ticas. Mi objetivo es hacer que estos campos sean f\u00e1cilmente comprensibles para todos, proporcionando las herramientas para explorar no solo el mundo que nos rodea, sino tambi\u00e9n las profundidades de nuestra propia existencia y el orden natural que nos conecta con el cosmos.","sameAs":["http:\/\/toposuranos.com\/material"],"url":"http:\/\/toposuranos.com\/material\/author\/giorgio-reveco\/"}]}},"_links":{"self":[{"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/posts\/31437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/comments?post=31437"}],"version-history":[{"count":0,"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/posts\/31437\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/media\/31365"}],"wp:attachment":[{"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/media?parent=31437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/categories?post=31437"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/toposuranos.com\/material\/wp-json\/wp\/v2\/tags?post=31437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}