{"id":39936,"date":"2025-05-26T13:57:13","date_gmt":"2025-05-26T05:57:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/39936.html"},"modified":"2025-05-26T13:57:13","modified_gmt":"2025-05-26T05:57:13","slug":"c-c%e8%b7%b3%e5%8a%a8%e7%9a%84%e7%88%b1%e5%bf%83","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/39936.html","title":{"rendered":"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3"},"content":{"rendered":"<h2><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1020\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250526055711-683402b72add7.gif\" width=\"1200\" \/><\/h2>\n<h2 id=\"main-toc\">\u7cfb\u5217\u6587\u7ae0<\/h2>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\">\n<tr>\u5e8f\u53f7\u76f4\u8fbe\u94fe\u63a5<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td><span>C\/C&#043;&#043;\u674e\u5ccb\u540c\u6b3e\u8df3\u52a8\u7684\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><span>C\/C&#043;&#043;\u8df3\u52a8\u7684\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td><span>C\/C&#043;&#043;\u7ecf\u5178\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td><span>C\/C&#043;&#043;\u6ee1\u5c4f\u98d8\u5b57<\/span><\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td><span>C\/C&#043;&#043;\u5927\u96ea\u7eb7\u98de<\/span><\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td><span>C\/C&#043;&#043;\u9ed1\u5ba2\u5e1d\u56fd\u5b57\u6bcd\u96e8<\/span><\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td><span>C\/C&#043;&#043;\u6a31\u82b1\u6811<\/span><\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td><span>C\/C&#043;&#043;\u5965\u7279\u66fc<\/span><\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td><span>C\/C&#043;&#043;\u7cbe\u7f8e\u5723\u8bde\u6811<\/span><\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td><span>C\/C&#043;&#043;\u4fc4\u7f57\u65af\u65b9\u5757\u5c0f\u6e38\u620f<\/span><\/td>\n<\/tr>\n<tr>\n<td>11<\/td>\n<td><span>C\/C&#043;&#043;\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f<\/span><\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td><span>C\/C&#043;&#043;\u5b64\u5355\u53c8\u707f\u70c2\u7684\u795e<\/span><\/td>\n<\/tr>\n<tr>\n<td>13<\/td>\n<td><span>C\/C&#043;&#043;\u95ea\u70c1\u7684\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td><span>C\/C&#043;&#043;\u54c6\u5566A\u68a6<\/span><\/td>\n<\/tr>\n<tr>\n<td>15<\/td>\n<td><span>C\/C&#043;&#043;\u7b80\u5355\u5723\u8bde\u6811<\/span><\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td><span>C\/C&#043;&#043;\u5c0f\u5b87\u5b99<\/span><\/td>\n<\/tr>\n<tr>\n<td>17<\/td>\n<td><span>C\/C&#043;&#043;\u51b0\u58a9\u58a9<\/span><\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td><span>C\/C&#043;&#043;\u4e03\u5f69\u82b1\u6735<\/span><\/td>\n<\/tr>\n<tr>\n<td>19<\/td>\n<td><span>C\/C&#043;&#043;\u73ab\u7470\u82b1<\/span><\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td><span>C\/C&#043;&#043;\u5c0f\u732a\u4f69\u5947<\/span><\/td>\n<\/tr>\n<tr>\n<td>21<\/td>\n<td><span>C\/C&#043;&#043;\u7b80\u6613\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>22<\/td>\n<td><span>C\/C&#043;&#043;\u6d41\u661f\u96e8\u2460<\/span><\/td>\n<\/tr>\n<tr>\n<td>23<\/td>\n<td><span>C\/C&#043;&#043;2048\u5c0f\u6e38\u620f<\/span><\/td>\n<\/tr>\n<tr>\n<td>24<\/td>\n<td><span>C\/C&#043;&#043;\u7231\u5fc3\u5723\u8bde\u6811<\/span><\/td>\n<\/tr>\n<tr>\n<td>25<\/td>\n<td><span>C\/C&#043;&#043;\u6587\u5b57\u8dd1\u9a6c\u706f<\/span><\/td>\n<\/tr>\n<tr>\n<td>26<\/td>\n<td><span>C\/C&#043;&#043;\u6559\u5e08\u5de5\u4f5c\u91cf\u7ba1\u7406\u7cfb\u7edf<\/span><\/td>\n<\/tr>\n<tr>\n<td>27<\/td>\n<td><span>C\/C&#043;&#043;\u6ee1\u5929\u7e41\u661f<\/span><\/td>\n<\/tr>\n<tr>\n<td>28<\/td>\n<td><span>C\/C&#043;&#043;\u6f02\u6d6e\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>29<\/td>\n<td><span>C\/C&#043;&#043;\u4e94\u5b50\u68cb\u5c0f\u6e38\u620f<\/span><\/td>\n<\/tr>\n<tr>\n<td>30<\/td>\n<td><span>C\/C&#043;&#043;\u7403\u7403\u5927\u4f5c\u6218\u5c0f\u6e38\u620f<\/span><\/td>\n<\/tr>\n<tr>\n<td>31<\/td>\n<td><span>C\/C&#043;&#043;\u8d70\u8ff7\u5bab\u5c0f\u6e38\u620f<\/span><\/td>\n<\/tr>\n<tr>\n<td>32<\/td>\n<td><span>C\/C&#043;&#043;\u7c89\u8272\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>33<\/td>\n<td><span>C\/C&#043;&#043;\u68d5\u8272\u5c0f\u718a<\/span><\/td>\n<\/tr>\n<tr>\n<td>34<\/td>\n<td><span>C\/C&#043;&#043;\u7c89\u8272\u52a8\u6001\u7231\u5fc3<\/span><\/td>\n<\/tr>\n<tr>\n<td>35<\/td>\n<td><span>C\/C&#043;&#043;\u70ab\u9177\u70df\u82b1\u2460<\/span><\/td>\n<\/tr>\n<tr>\n<td>36<\/td>\n<td><span>C\/C&#043;&#043;\u70ab\u9177\u70df\u82b1\u2461<\/span><\/td>\n<\/tr>\n<tr>\n<td>37<\/td>\n<td><span>C\/C&#043;&#043;\u70ab\u9177\u70df\u82b1\u2462<\/span><\/td>\n<\/tr>\n<tr>\n<td>38<\/td>\n<td><span>C\/C&#043;&#043;\u70ab\u9177\u70df\u82b1\u2463<\/span><\/td>\n<\/tr>\n<tr>\n<td>39<\/td>\n<td><span>C\/C&#043;&#043;\u661f\u7a7a\u6f29\u6da1<\/span><\/td>\n<\/tr>\n<tr>\n<td>40<\/td>\n<td><span>C\/C&#043;&#043;\u6d41\u661f\u96e8\u2461<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\u656c\u8bf7\u671f\u5f85\u2026\u2026<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u5199\u5728\u524d\u9762<\/h2>\n<p>C\/C&#043;&#043;\u8bed\u8a00\u5b9e\u73b0\u674e\u5ccb\u540c\u6b3e\u8df3\u52a8\u7684\u7231\u5fc3\u5b8c\u6574\u4ee3\u7801\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u9700\u8981\u77e5\u9053C&#043;&#043;\u4f5c\u4e3a\u4e00\u79cd\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00&#xff0c;\u62e5\u6709\u5f3a\u5927\u7684\u529f\u80fd\u548c\u7075\u6d3b\u7684\u8bed\u6cd5&#xff0c;\u975e\u5e38\u9002\u5408\u7528\u6765\u5236\u4f5c\u5404\u79cd\u6709\u8da3\u7684\u52a8\u753b\u6548\u679c\u3002\u800c\u8df3\u52a8\u7684\u7231\u5fc3&#xff0c;\u6b63\u662f\u4e00\u79cd\u65e2\u7b80\u5355\u53c8\u5bcc\u6709\u521b\u610f\u7684\u52a8\u753b\u6548\u679c&#xff0c;\u975e\u5e38\u9002\u5408\u7528\u6765\u4f5c\u4e3a\u7f16\u7a0b\u521d\u5b66\u8005\u7684\u7ec3\u4e60\u9879\u76ee\u3002\u8981\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c&#xff0c;\u6211\u4eec\u9700\u8981\u7528\u5230C&#043;&#043;\u7684\u56fe\u5f62\u5e93\u548c\u5b9a\u65f6\u5668\u529f\u80fd\u3002\u56fe\u5f62\u5e93\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u63a7\u5236\u53f0\u6216\u7a97\u53e3\u4e2d\u7ed8\u5236\u51fa\u7231\u5fc3\u7684\u5f62\u72b6&#xff0c;\u800c\u5b9a\u65f6\u5668\u5219\u53ef\u4ee5\u8ba9\u7231\u5fc3\u4ee5\u4e00\u5b9a\u7684\u9891\u7387\u8df3\u52a8\u8d77\u6765\u3002<\/p>\n<h2 id=\"%E5%86%99%E5%9C%A8%E5%89%8D%E9%9D%A2\">\u6280\u672f\u9700\u6c42<\/h2>\n<li>\n<p>\u56fe\u5f62\u5e93&#xff08;Graphics Library&#xff09;&#xff1a;\u4f7f\u7528 graphics.h \u63d0\u4f9b\u7684\u56fe\u5f62\u529f\u80fd\u6765\u7ed8\u5236\u70b9\u3001\u5706\u5f62\u3001\u6587\u5b57\u7b49\u56fe\u5f62\u5143\u7d20\u3002\u901a\u8fc7 setfillcolor\u3001solidcircle\u3001outtextxy \u7b49\u51fd\u6570\u6765\u63a7\u5236\u56fe\u5f62\u7684\u989c\u8272\u3001\u5f62\u72b6\u548c\u4f4d\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>\u6570\u5b66\u8fd0\u7b97\u4e0e\u516c\u5f0f&#xff1a;\u4ee3\u7801\u4f7f\u7528\u4e86\u6570\u5b66\u516c\u5f0f\u751f\u6210\u5fc3\u5f62\u66f2\u7ebf\u7684\u70b9\u5750\u6807\u3002\u7279\u522b\u662f\u901a\u8fc7 sin \u548c cos \u51fd\u6570&#xff0c;\u7ed3\u5408\u53c2\u6570\u65b9\u7a0b\u7ed8\u5236\u5fc3\u5f62\u66f2\u7ebf\u3002\u540c\u65f6\u4f7f\u7528\u4e86\u8ddd\u79bb\u8ba1\u7b97\u516c\u5f0f sqrt(pow(x, 2) &#043; pow(y, 2)) \u6765\u5904\u7406\u70b9\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n<\/li>\n<li>\n<p>\u968f\u673a\u6570\u751f\u6210&#xff1a;\u901a\u8fc7 rand() \u51fd\u6570\u751f\u6210\u968f\u673a\u6570&#xff0c;\u7528\u4e8e\u968f\u673a\u5316\u56fe\u5f62\u7684\u989c\u8272\u3001\u5927\u5c0f\u3001\u4f4d\u7f6e\u7b49&#xff0c;\u4f7f\u5f97\u52a8\u753b\u6548\u679c\u66f4\u5177\u52a8\u611f\u548c\u53d8\u5316\u6027\u3002\u968f\u673a\u6570\u8fd8\u88ab\u7528\u6765\u63a7\u5236\u6bcf\u4e2a\u70b9\u662f\u5426\u751f\u6210\u3002<\/p>\n<\/li>\n<li>\n<p>\u52a8\u753b\u751f\u6210&#xff1a;\u901a\u8fc7\u9010\u5e27\u751f\u6210\u56fe\u50cf&#xff0c;\u5229\u7528 saveimage \u548c loadimage \u51fd\u6570\u4fdd\u5b58\u5e76\u52a0\u8f7d\u6bcf\u4e00\u5e27\u56fe\u50cf&#xff0c;\u5b9e\u73b0\u52a8\u753b\u6548\u679c\u3002\u6bcf\u5e27\u7684\u70b9\u4f4d\u7f6e\u968f\u7740\u65f6\u95f4\u53d8\u5316&#xff0c;\u5f62\u6210\u52a8\u6001\u6548\u679c\u3002<\/p>\n<\/li>\n<li>\n<p>\u56fe\u50cf\u5904\u7406&#xff1a;\u5229\u7528 setorigin\u3001setaspectratio \u7b49\u51fd\u6570\u8c03\u6574\u56fe\u5f62\u5750\u6807\u7cfb&#xff0c;\u4f7f\u5f97\u56fe\u5f62\u80fd\u9002\u5e94\u4e0d\u540c\u7684\u5c4f\u5e55\u5206\u8fa8\u7387\u548c\u663e\u793a\u6548\u679c\u3002<\/p>\n<\/li>\n<li>\n<p>\u6587\u672c\u7ed8\u5236&#xff1a;\u4f7f\u7528 outtextxy \u51fd\u6570\u5c06\u6587\u672c\u7ed8\u5236\u5230\u56fe\u5f62\u4e0a&#xff0c;\u8fd9\u91cc\u7528\u6765\u663e\u793a&#034;\u6211\u7231\u4f60&#034;\u7b49\u4fe1\u606f&#xff0c;\u589e\u5f3a\u56fe\u5f62\u7684\u8868\u73b0\u529b\u3002<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58\u4e0e\u6027\u80fd\u7ba1\u7406&#xff1a;\u901a\u8fc7\u5b58\u50a8\u6bcf\u4e00\u5e27\u7684\u56fe\u50cf&#xff0c;\u4f7f\u7528 images[frame] \u6570\u7ec4\u6765\u7ba1\u7406\u56fe\u50cf\u6570\u636e&#xff0c;\u786e\u4fdd\u6bcf\u4e00\u5e27\u80fd\u591f\u88ab\u72ec\u7acb\u5904\u7406\u548c\u4fdd\u5b58\u3002<\/p>\n<\/li>\n<h2 id=\"%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA\">\u73af\u5883\u642d\u5efa<\/h2>\n<p>\u73af\u5883&#xff1a;C\/C&#043;&#043;<\/p>\n<p>\u8f6f\u4ef6&#xff1a;Visual Studio 2022<\/p>\n<p>\u5b89\u88c5\u6559\u7a0b&#xff1a;<span>C\u8bed\u8a00\u73af\u5883\u642d\u5efa\u6559\u7a0b&#xff08;Visual Studio&#xff09;<\/span><\/p>\n<h3 id=\"EasyX%E7%AE%80%E4%BB%8B\">1. EasyX\u662f\u4ec0\u4e48<\/h3>\n<p>EasyX\u662f\u4e00\u4e2a\u4e13\u4e3aC&#043;&#043;\u521d\u5b66\u8005\u548c\u7231\u597d\u8005\u8bbe\u8ba1\u7684\u56fe\u5f62\u5e93\u3002\u8be5\u5e93\u4ee5\u7b80\u6d01\u6613\u7528\u3001\u529f\u80fd\u5b9e\u7528\u4e3a\u5b97\u65e8&#xff0c;\u901a\u8fc7\u5c01\u88c5Windows GDI\u63a5\u53e3&#xff0c;\u6781\u5927\u964d\u4f4e\u4e86C&#043;&#043;\u7f16\u7a0b\u4e2d\u56fe\u5f62\u754c\u9762\u8bbe\u8ba1\u7684\u590d\u6742\u5ea6&#xff0c;\u4f7f\u5f97\u7528\u6237\u80fd\u591f\u5feb\u901f\u4e0a\u624b\u5e76\u5b9e\u73b0\u5404\u7c7b\u56fe\u5f62\u56fe\u50cf\u5904\u7406\u4efb\u52a1\u3002<\/p>\n<p>EasyX\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u4e30\u5bcc\u7684API\u51fd\u6570&#xff0c;\u6db5\u76d6\u4e86\u7ed8\u5236\u57fa\u672c\u56fe\u5f62&#xff08;\u5982\u7ebf\u6bb5\u3001\u5706\u5f62\u3001\u77e9\u5f62\u7b49&#xff09;\u3001\u586b\u5145\u56fe\u5f62\u3001\u663e\u793a\u6587\u672c\u3001\u52a0\u8f7d\u4e0e\u4fdd\u5b58\u56fe\u7247\u3001\u989c\u8272\u8bbe\u7f6e\u4ee5\u53ca\u9f20\u6807\u952e\u76d8\u4e8b\u4ef6\u5904\u7406\u7b49\u529f\u80fd\u3002\u901a\u8fc7\u7b80\u5355\u7684\u51fd\u6570\u8c03\u7528&#xff0c;\u5f00\u53d1\u8005\u53ef\u4ee5\u9ad8\u6548\u5730\u8fdb\u884c2D\u56fe\u5f62\u7ed8\u5236\u548c\u4ea4\u4e92\u5f0f\u7a0b\u5e8f\u8bbe\u8ba1\u3002<\/p>\n<p>\u603b\u7684\u6765\u8bf4&#xff0c;EasyX\u4ee5\u5176\u53cb\u597d\u7684\u5b66\u4e60\u66f2\u7ebf\u548c\u9ad8\u6548\u7684\u56fe\u5f62\u5904\u7406\u80fd\u529b&#xff0c;\u6781\u5927\u5730\u6fc0\u53d1\u4e86C&#043;&#043;\u521d\u5b66\u8005\u5bf9\u8ba1\u7b97\u673a\u56fe\u5f62\u5b66\u7684\u5174\u8da3&#xff0c;\u662f\u5e7f\u5927\u7f16\u7a0b\u5165\u95e8\u8005\u548c\u6559\u80b2\u9886\u57df\u5e7f\u6cdb\u91c7\u7528\u7684\u4e00\u6b3e\u56fe\u5f62\u5e93\u5de5\u5177\u3002<\/p>\n<h3 id=\"EasyX%E4%B8%8B%E8%BD%BD%E5%AE%89%E8%A3%85\">2. \u4e0b\u8f7d\u5b89\u88c5EasyX<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"871\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250526055712-683402b81dbd8.png\" width=\"1200\" \/>\u200b<\/p>\n<p>1.\u8fdb\u5165EasyX\u5b98\u7f51&#xff0c;\u70b9\u51fb\u4e0b\u8f7d\u6309\u94ae\u5f00\u59cb\u4e0b\u8f7d<\/p>\n<p>2.\u4e0b\u8f7d\u5b8c\u6210\u540e\u8fdb\u5165\u4e0b\u8f7d\u76ee\u5f55&#xff0c;\u53cc\u51fb.exe\u6587\u4ef6\u65e0\u8111\u5b89\u88c5\u5373\u53ef<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u8ba9\u6211\u4eec\u4e00\u6b65\u6b65\u6765\u5b9e\u73b0\u8fd9\u4e2a\u8df3\u52a8\u7684\u7231\u5fc3\u3002\u9996\u5148&#xff0c;\u6211\u4eec\u9700\u8981\u901a\u8fc7\u4e00\u7cfb\u5217\u7684\u6570\u5b66\u516c\u5f0f\u6765\u5b9a\u4e49\u7231\u5fc3\u7684\u5f62\u72b6&#xff0c;\u6bd4\u5982\u4f7f\u7528\u53c2\u6570\u65b9\u7a0b\u6765\u63cf\u8ff0\u7231\u5fc3\u7684\u8f6e\u5ed3\u3002\u7136\u540e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528C&#043;&#043;\u7684\u56fe\u5f62\u5e93\u6765\u7ed8\u5236\u51fa\u8fd9\u4e2a\u5f62\u72b6\u3002\u5f53\u7ed8\u5236\u597d\u7231\u5fc3\u540e&#xff0c;\u5c31\u8981\u60f3\u529e\u6cd5\u8ba9\u5b83\u8df3\u52a8\u8d77\u6765\u4e86&#xff0c;\u8fd9\u91cc\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528C&#043;&#043;\u7684\u5b9a\u65f6\u5668\u529f\u80fd&#xff0c;\u8bbe\u7f6e\u4e00\u4e2a\u5408\u9002\u7684\u65f6\u95f4\u95f4\u9694&#xff0c;\u8ba9\u7231\u5fc3\u5728\u6bcf\u4e2a\u65f6\u95f4\u95f4\u9694\u5185\u6539\u53d8\u4f4d\u7f6e\u6216\u5927\u5c0f&#xff0c;\u4ece\u800c\u4ea7\u751f\u8df3\u52a8\u7684\u6548\u679c\u3002<\/p>\n<h2 id=\"%E5%AE%8C%E6%95%B4%E4%BB%A3%E7%A0%81\">\u5b8c\u6574\u4ee3\u7801<\/h2>\n<p>#include &lt;graphics.h&gt;<br \/>\n#include &lt;conio.h&gt;<br \/>\n#include &lt;ctime&gt;<br \/>\n#include &lt;cmath&gt;<br \/>\n#include &lt;cstdlib&gt;<\/p>\n<p>struct Point {<br \/>\n    double x, y;<br \/>\n    COLORREF color;<br \/>\n};<\/p>\n<p>const int MAX_POINTS &#061; 256;<br \/>\nconst COLORREF colors[MAX_POINTS] &#061; {<br \/>\n    RGB(255, 192, 203), \/\/ \u6d45\u7c89\u8272 (Light Pink)<br \/>\n    RGB(255, 182, 193), \/\/ \u6de1\u7c89\u7ea2 (LightPink)<br \/>\n    RGB(255, 105, 180), \/\/ \u70ed\u7c89\u7ea2 (HotPink)<br \/>\n    RGB(255, 20, 147),  \/\/ \u6df1\u7c89\u8272 (DeepPink)<br \/>\n    RGB(219, 112, 147), \/\/ \u6d53\u7c89\u7ea2 (PaleVioletRed)<br \/>\n    RGB(255, 174, 185), \/\/ \u6d45\u73ab\u7470\u7ea2 (LightPink)<br \/>\n    RGB(255, 0, 144)    \/\/ \u7d2b\u7ea2\u8272 (Crimson)<br \/>\n};<br \/>\nconst int xScreen &#061; GetSystemMetrics(SM_CXSCREEN);<br \/>\nconst int yScreen &#061; GetSystemMetrics(SM_CYSCREEN) &#8211; 100;<br \/>\nconst double PI &#061; 3.14159265359;<br \/>\nconst double E &#061; 2.71828;<br \/>\nconst double AVG_DISTANCE &#061; 0.162;<br \/>\nconst int NUM_ORIGIN_POINTS &#061; 506;<br \/>\nconst int NUM_CIRCLES &#061; 210;<br \/>\nconst int NUM_FRAMES &#061; 20;<br \/>\nconst int COLOR_RANGE &#061; 6;<\/p>\n<p>Point origin_points[NUM_ORIGIN_POINTS];<br \/>\nPoint points[NUM_CIRCLES * NUM_ORIGIN_POINTS];<br \/>\nIMAGE images[NUM_FRAMES];<\/p>\n<p>int create_random(int min, int max) {<br \/>\n    return rand() % (max &#8211; min &#043; 1) &#043; min;<br \/>\n}<\/p>\n<p>void create_data() {<br \/>\n    int index &#061; 0;<br \/>\n    double x1 &#061; 0, y1 &#061; 0, x2 &#061; 0, y2 &#061; 0;<\/p>\n<p>    \/\/ Generate origin points<br \/>\n    for (double radian &#061; 0.1; radian &lt;&#061; 2 * PI; radian &#043;&#061; 0.005) {<br \/>\n        x2 &#061; 16 * pow(sin(radian), 3);<br \/>\n        y2 &#061; 13 * cos(radian) &#8211; 5 * cos(2 * radian) &#8211; 2 * cos(3 * radian) &#8211; cos(4 * radian);<br \/>\n        double distance &#061; sqrt(pow(x2 &#8211; x1, 2) &#043; pow(y2 &#8211; y1, 2));<br \/>\n        if (distance &gt; AVG_DISTANCE) {<br \/>\n            x1 &#061; x2, y1 &#061; y2;<br \/>\n            origin_points[index].x &#061; x2;<br \/>\n            origin_points[index&#043;&#043;].y &#061; y2;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/\/ Generate points<br \/>\n    index &#061; 0;<br \/>\n    for (double size &#061; 0.1, lightness &#061; 1.5; size &lt;&#061; 20; size &#043;&#061; 0.1) {<br \/>\n        double success_p &#061; 1 \/ (1 &#043; pow(E, 8 &#8211; size \/ 2));<br \/>\n        if (lightness &gt; 1) lightness -&#061; 0.0025;<br \/>\n        for (int i &#061; 0; i &lt; NUM_ORIGIN_POINTS; &#043;&#043;i) {<br \/>\n            if (success_p &gt; create_random(0, 100) \/ 100.0) {<br \/>\n                COLORREF color &#061; colors[create_random(0, COLOR_RANGE)];<br \/>\n                points[index].color &#061; RGB(GetRValue(color) \/ lightness, GetGValue(color) \/ lightness, GetBValue(color) \/ lightness);<br \/>\n                points[index].x &#061; size * origin_points[i].x &#043; create_random(-4, 4);<br \/>\n                points[index&#043;&#043;].y &#061; size * origin_points[i].y &#043; create_random(-4, 4);<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n    int points_size &#061; index;<\/p>\n<p>    \/\/ Generate images<br \/>\n    for (int frame &#061; 0; frame &lt; NUM_FRAMES; &#043;&#043;frame) {<br \/>\n        images[frame] &#061; IMAGE(xScreen, yScreen);<br \/>\n        SetWorkingImage(&amp;images[frame]);<br \/>\n        setorigin(xScreen \/ 2, yScreen \/ 2);<br \/>\n        setaspectratio(1, -1);<\/p>\n<p>        for (index &#061; 0; index &lt; points_size; &#043;&#043;index) {<br \/>\n            double x &#061; points[index].x, y &#061; points[index].y;<br \/>\n            double distance &#061; sqrt(pow(x, 2) &#043; pow(y, 2));<br \/>\n            double distance_increase &#061; -0.0009 * distance * distance &#043; 0.35714 * distance &#043; 5;<br \/>\n            double x_increase &#061; distance_increase * x \/ distance \/ NUM_FRAMES;<br \/>\n            double y_increase &#061; distance_increase * y \/ distance \/ NUM_FRAMES;<br \/>\n            points[index].x &#043;&#061; x_increase;<br \/>\n            points[index].y &#043;&#061; y_increase;<br \/>\n            setfillcolor(points[index].color);<br \/>\n            solidcircle(points[index].x, points[index].y, 1);<br \/>\n        }<\/p>\n<p>\u2026\u2026 <\/p>\n<h2 id=\"%E4%B8%8B%E8%BD%BD%E4%BB%A3%E7%A0%81\">\u4ee3\u7801\u5206\u6790<\/h2>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4f7f\u7528\u4e86 C&#043;&#043; \u4e2d\u7684\u56fe\u5f62\u5e93\u6765\u751f\u6210\u4e00\u7cfb\u5217\u52a8\u753b\u56fe\u50cf&#xff0c;\u5e76\u5c55\u793a\u4e00\u4e2a\u57fa\u4e8e\u7231\u5fc3\u5f62\u72b6\u7684\u56fe\u6848\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u5206\u6790\u8be5\u4ee3\u7801\u7684\u5404\u4e2a\u90e8\u5206&#xff0c;\u5305\u62ec\u7ed3\u6784\u4f53\u5b9a\u4e49\u3001\u5e38\u91cf\u58f0\u660e\u3001\u51fd\u6570\u5b9e\u73b0\u548c\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002<\/p>\n<h3 id=\"1.%20%E5%BC%95%E7%94%A8%E7%9A%84%E5%A4%B4%E6%96%87%E4%BB%B6\">1. \u5f15\u7528\u7684\u5934\u6587\u4ef6<\/h3>\n<p>#include &lt;graphics.h&gt;<br \/>\n#include &lt;conio.h&gt;<br \/>\n#include &lt;ctime&gt;<br \/>\n#include &lt;cmath&gt;<br \/>\n#include &lt;cstdlib&gt;<\/p>\n<ul>\n<li>graphics.h&#xff1a;\u662f C&#043;&#043; \u4e2d\u7684\u56fe\u5f62\u5904\u7406\u5e93&#xff0c;\u63d0\u4f9b\u4e86\u7528\u4e8e\u7ed8\u5236\u56fe\u5f62\u548c\u56fe\u50cf\u7684\u51fd\u6570\u3002<\/li>\n<li>conio.h&#xff1a;\u7528\u4e8e\u63a7\u5236\u53f0\u8f93\u5165\u8f93\u51fa&#xff0c;\u5305\u62ec _kbhit()&#xff08;\u68c0\u6d4b\u662f\u5426\u6709\u6309\u952e\u8f93\u5165&#xff09;\u7b49\u529f\u80fd\u3002<\/li>\n<li>ctime&#xff1a;\u7528\u4e8e\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4&#xff0c;\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u968f\u673a\u6570\u3002<\/li>\n<li>cmath&#xff1a;\u63d0\u4f9b\u6570\u5b66\u8fd0\u7b97\u51fd\u6570&#xff0c;\u5982 pow\u3001sqrt \u7b49\u3002<\/li>\n<li>cstdlib&#xff1a;\u7528\u4e8e\u751f\u6210\u968f\u673a\u6570\u7b49\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<h3 id=\"2.%20%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84\">2. \u6570\u636e\u7ed3\u6784<\/h3>\n<p>struct Point {<br \/>\n    double x, y;<br \/>\n    COLORREF color;<br \/>\n};<\/p>\n<p>\u5b9a\u4e49\u4e86\u4e00\u4e2a Point \u7ed3\u6784\u4f53&#xff0c;\u7528\u6765\u5b58\u50a8\u4e8c\u7ef4\u5750\u6807\u70b9\u7684 x \u548c y \u503c&#xff0c;\u4ee5\u53ca\u4e00\u4e2a color \u5c5e\u6027&#xff0c;\u4ee3\u8868\u8be5\u70b9\u7684\u989c\u8272\u3002COLORREF \u662f\u4e00\u4e2a\u989c\u8272\u7684\u7ed3\u6784&#xff0c;\u901a\u5e38\u5305\u542b RGB \u989c\u8272\u503c\u3002<\/p>\n<h3 id=\"3.%20%E5%B8%B8%E9%87%8F%E5%A3%B0%E6%98%8E\">3. \u5e38\u91cf\u58f0\u660e<\/h3>\n<p>const int MAX_POINTS &#061; 256;<br \/>\nconst COLORREF colors[MAX_POINTS] &#061; {<br \/>\n    RGB(255, 192, 203), RGB(255, 182, 193), RGB(255, 105, 180),<br \/>\n    RGB(255, 20, 147), RGB(219, 112, 147), RGB(255, 174, 185), RGB(255, 0, 144)<br \/>\n};<br \/>\nconst int xScreen &#061; GetSystemMetrics(SM_CXSCREEN);<br \/>\nconst int yScreen &#061; GetSystemMetrics(SM_CYSCREEN) &#8211; 100;<br \/>\nconst double PI &#061; 3.14159265359;<br \/>\nconst double E &#061; 2.71828;<br \/>\nconst double AVG_DISTANCE &#061; 0.162;<br \/>\nconst int NUM_ORIGIN_POINTS &#061; 506;<br \/>\nconst int NUM_CIRCLES &#061; 210;<br \/>\nconst int NUM_FRAMES &#061; 20;<br \/>\nconst int COLOR_RANGE &#061; 6;<\/p>\n<ul>\n<li>MAX_POINTS&#xff1a;\u6700\u5927\u70b9\u6570&#xff0c;\u8868\u793a\u56fe\u50cf\u4e2d\u6700\u591a\u53ef\u4ee5\u5305\u542b 256 \u4e2a\u70b9\u3002<\/li>\n<li>colors&#xff1a;\u5b58\u50a8\u4e86 7 \u79cd\u989c\u8272\u7684 RGB \u503c&#xff0c;\u8868\u793a\u52a8\u753b\u4e2d\u4f7f\u7528\u7684\u989c\u8272\u8303\u56f4\u3002<\/li>\n<li>xScreen, yScreen&#xff1a;\u83b7\u53d6\u5c4f\u5e55\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6&#xff0c;\u5e76\u4e3a\u7ed8\u5236\u56fe\u50cf\u7559\u51fa\u4e00\u4e9b\u7a7a\u95f4\u3002<\/li>\n<li>PI \u548c E&#xff1a;\u5706\u5468\u7387\u548c\u81ea\u7136\u5e38\u6570\u3002<\/li>\n<li>AVG_DISTANCE&#xff1a;\u7528\u4e8e\u8ba1\u7b97\u70b9\u4e4b\u95f4\u7684\u5e73\u5747\u8ddd\u79bb\u3002<\/li>\n<li>NUM_ORIGIN_POINTS&#xff1a;\u539f\u59cb\u6570\u636e\u70b9\u7684\u6570\u91cf\u3002<\/li>\n<li>NUM_CIRCLES&#xff1a;\u751f\u6210\u7684\u5706\u5f62\u70b9\u7684\u6570\u91cf\u3002<\/li>\n<li>NUM_FRAMES&#xff1a;\u52a8\u753b\u5e27\u7684\u6570\u91cf\u3002<\/li>\n<li>COLOR_RANGE&#xff1a;\u989c\u8272\u8303\u56f4&#xff0c;\u7528\u4e8e\u9009\u62e9\u989c\u8272\u7684\u968f\u673a\u6570\u8303\u56f4\u3002<\/li>\n<\/ul>\n<h3 id=\"4.%20%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F\">4. \u5168\u5c40\u53d8\u91cf<\/h3>\n<p>Point origin_points[NUM_ORIGIN_POINTS];<br \/>\nPoint points[NUM_CIRCLES * NUM_ORIGIN_POINTS];<br \/>\nIMAGE images[NUM_FRAMES];<\/p>\n<ul>\n<li>origin_points&#xff1a;\u5b58\u50a8\u539f\u59cb\u7684\u70b9\u6570\u636e&#xff0c;\u7528\u4e8e\u8ba1\u7b97\u56fe\u6848\u3002<\/li>\n<li>points&#xff1a;\u5b58\u50a8\u56fe\u5f62\u4e2d\u6bcf\u4e2a\u70b9\u7684\u6570\u636e&#xff0c;\u5305\u62ec\u5750\u6807\u548c\u989c\u8272\u3002<\/li>\n<li>images&#xff1a;\u5b58\u50a8\u6bcf\u4e00\u5e27\u751f\u6210\u7684\u56fe\u50cf\u3002<\/li>\n<\/ul>\n<h3 id=\"5.%20%E5%88%9B%E5%BB%BA%E9%9A%8F%E6%9C%BA%E6%95%B0%E7%9A%84%E8%BE%85%E5%8A%A9%E5%87%BD%E6%95%B0\">5. \u521b\u5efa\u968f\u673a\u6570\u7684\u8f85\u52a9\u51fd\u6570<\/h3>\n<p>int create_random(int min, int max) {<br \/>\n    return rand() % (max &#8211; min &#043; 1) &#043; min;<br \/>\n}<\/p>\n<p>\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u751f\u6210\u4e00\u4e2a\u6307\u5b9a\u8303\u56f4\u5185\u7684\u968f\u673a\u6574\u6570\u3002\u901a\u8fc7 rand() \u51fd\u6570\u751f\u6210\u4e00\u4e2a\u968f\u673a\u6570&#xff0c;\u7136\u540e\u901a\u8fc7\u6a21\u8fd0\u7b97\u9650\u5236\u5176\u5728\u7ed9\u5b9a\u7684\u533a\u95f4\u5185\u3002<\/p>\n<h3 id=\"6.%20create_data()%20%E5%87%BD%E6%95%B0\">6. create_data() \u51fd\u6570<\/h3>\n<p>\u8be5\u51fd\u6570\u662f\u6574\u4e2a\u7a0b\u5e8f\u7684\u6838\u5fc3&#xff0c;\u8d1f\u8d23\u751f\u6210\u539f\u59cb\u70b9\u6570\u636e\u3001\u8ba1\u7b97\u70b9\u7684\u4f4d\u7f6e&#xff0c;\u5e76\u751f\u6210\u52a8\u753b\u7684\u5e27\u3002<\/p>\n<h4 id=\"6.1%20%E7%94%9F%E6%88%90%E5%8E%9F%E5%A7%8B%E6%95%B0%E6%8D%AE%E7%82%B9\">6.1 \u751f\u6210\u539f\u59cb\u6570\u636e\u70b9<\/h4>\n<p>for (double radian &#061; 0.1; radian &lt;&#061; 2 * PI; radian &#043;&#061; 0.005) {<br \/>\n    x2 &#061; 16 * pow(sin(radian), 3);<br \/>\n    y2 &#061; 13 * cos(radian) &#8211; 5 * cos(2 * radian) &#8211; 2 * cos(3 * radian) &#8211; cos(4 * radian);<br \/>\n    double distance &#061; sqrt(pow(x2 &#8211; x1, 2) &#043; pow(y2 &#8211; y1, 2));<br \/>\n    if (distance &gt; AVG_DISTANCE) {<br \/>\n        x1 &#061; x2, y1 &#061; y2;<br \/>\n        origin_points[index].x &#061; x2;<br \/>\n        origin_points[index&#043;&#043;].y &#061; y2;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u751f\u6210\u4e86\u4e00\u4e2a\u5fc3\u5f62\u66f2\u7ebf\u7684\u539f\u59cb\u6570\u636e\u70b9&#xff0c;\u4f7f\u7528\u4e86 parametric equations \u6765\u7ed8\u5236\u5fc3\u5f62\u3002\u901a\u8fc7\u904d\u5386\u89d2\u5ea6 radian&#xff0c;\u8ba1\u7b97 x2 \u548c y2 \u7684\u5750\u6807&#xff0c;\u5e76\u6839\u636e\u8ddd\u79bb\u8fc7\u6ee4\u6389\u8fc7\u4e8e\u63a5\u8fd1\u7684\u70b9\u3002<\/p>\n<h4 id=\"6.2%20%E7%94%9F%E6%88%90%E5%9C%86%E5%BD%A2%E7%82%B9%E6%95%B0%E6%8D%AE\">6.2 \u751f\u6210\u5706\u5f62\u70b9\u6570\u636e<\/h4>\n<p>\u8fd9\u4e00\u90e8\u5206\u901a\u8fc7\u53d8\u5316 size \u548c lightness&#xff0c;\u751f\u6210\u4e86\u4e0d\u540c\u5927\u5c0f\u3001\u4e0d\u540c\u4eae\u5ea6\u7684\u70b9\u3002\u901a\u8fc7 success_p \u6765\u51b3\u5b9a\u70b9\u662f\u5426\u5e94\u5f53\u88ab\u751f\u6210&#xff0c;\u6700\u7ec8\u751f\u6210\u7684\u70b9\u88ab\u968f\u673a\u8bbe\u7f6e\u989c\u8272&#xff0c;\u5e76\u52a0\u5165\u5230 points \u6570\u7ec4\u4e2d\u3002<\/p>\n<h4 id=\"6.3%20%E7%94%9F%E6%88%90%E5%8A%A8%E7%94%BB%E5%B8%A7\">6.3 \u751f\u6210\u52a8\u753b\u5e27<\/h4>\n<p>\u8fd9\u4e00\u6bb5\u4ee3\u7801\u662f\u6838\u5fc3\u90e8\u5206&#xff0c;\u8d1f\u8d23\u7ed8\u5236\u548c\u52a8\u753b\u751f\u6210\u3002<\/p>\n<p>\u901a\u8fc7\u8ba1\u7b97\u6bcf\u4e2a\u70b9\u7684\u4f4d\u7f6e&#xff0c;\u7ed8\u5236\u5fc3\u5f62\u7684\u5404\u4e2a\u70b9&#xff0c;\u5e76\u751f\u6210\u52a8\u6001\u7684\u6548\u679c\u3002<\/p>\n<h3 id=\"7.%20%E6%80%BB%E7%BB%93\">7. \u603b\u7ed3<\/h3>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5b9e\u73b0\u4e86\u4e00\u4e2a\u57fa\u4e8e\u5fc3\u5f62\u56fe\u6848\u7684\u52a8\u6001\u751f\u6210\u52a8\u753b&#xff0c;\u6d89\u53ca\u5230\u6570\u5b66\u516c\u5f0f\u3001\u56fe\u5f62\u7ed8\u5236\u3001\u968f\u673a\u6570\u751f\u6210\u7b49\u591a\u4e2a\u65b9\u9762\u7684\u77e5\u8bc6\u3002\u5b83\u901a\u8fc7\u9010\u5e27\u7ed8\u5236\u6765\u521b\u5efa\u52a8\u753b\u6548\u679c&#xff0c;\u5e76\u901a\u8fc7\u4fee\u6539\u989c\u8272\u3001\u4f4d\u7f6e\u3001\u5927\u5c0f\u7b49\u53c2\u6570\u6765\u5b9e\u73b0\u52a8\u6001\u5c55\u793a\u3002<\/p>\n<h2>\u5199\u5728\u540e\u9762<\/h2>\n<p>\u6211\u662f\u4e00\u53ea\u6709\u8da3\u7684\u5154\u5b50&#xff0c;\u611f\u8c22\u4f60\u7684\u559c\u6b22&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1w\u6b21\uff0c\u70b9\u8d5e52\u6b21\uff0c\u6536\u85cf66\u6b21\u3002\u8fd9\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528C\/C++\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u674e\u5ccb\u540c\u6b3e\u8df3\u52a8\u7684\u7231\u5fc3\u52a8\u753b\u6548\u679c\u3002\u6587\u7ae0\u9996\u5148\u6982\u8ff0\u4e86C++\u8bed\u8a00\u5728\u56fe\u5f62\u5904\u7406\u65b9\u9762\u7684\u4f18\u52bf\uff0c\u5e76\u8be6\u7ec6\u8bf4\u660e\u4e86\u5b9e\u73b0\u8df3\u52a8\u7231\u5fc3\u6240\u9700\u7684\u6280\u672f\uff0c\u5305\u62ec\u56fe\u5f62\u5e93\u7684\u4f7f\u7528\u3001\u6570\u5b66\u516c\u5f0f\u7684\u5e94\u7528\u3001\u968f\u673a\u6570\u751f\u6210\u548c\u52a8\u753b\u751f\u6210\u7b49\u3002\u63a5\u7740\uff0c\u6587\u7ae0\u63d0\u4f9b\u4e86\u5b8c\u6574\u4ee3\u7801\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u4e86\u8be6\u7ec6\u5206\u6790\uff0c\u89e3\u91ca\u4e86\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684\u6570\u636e\u7ed3\u6784\u3001\u5e38\u91cf\u58f0\u660e\u3001\u51fd\u6570\u5b9e\u73b0\u548c\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b\u3002\u6700\u540e\uff0c\u6587\u7ae0\u603b\u7ed3\u4e86\u4ee3\u7801\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u5373\u901a\u8fc7\u9010\u5e27\u7ed8\u5236\u751f\u6210\u52a8\u6001\u5fc3\u5f62\u56fe\u6848\uff0c\u5c55\u793a\u4e86C++\u5728\u56fe\u5f62\u5904\u7406\u548c\u52a8\u753b\u5236\u4f5c\u4e2d\u7684\u5f3a\u5927\u80fd\u529b\u3002<\/p>\n","protected":false},"author":2,"featured_media":39934,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,174,190,3635],"topic":[],"class_list":{"0":"post-39936","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-server","8":"tag-c","10":"tag-190","11":"tag-3635"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C\/C++\u8df3\u52a8\u7684\u7231\u5fc3 - \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\/39936.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1w\u6b21\uff0c\u70b9\u8d5e52\u6b21\uff0c\u6536\u85cf66\u6b21\u3002\u8fd9\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528C\/C++\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u674e\u5ccb\u540c\u6b3e\u8df3\u52a8\u7684\u7231\u5fc3\u52a8\u753b\u6548\u679c\u3002\u6587\u7ae0\u9996\u5148\u6982\u8ff0\u4e86C++\u8bed\u8a00\u5728\u56fe\u5f62\u5904\u7406\u65b9\u9762\u7684\u4f18\u52bf\uff0c\u5e76\u8be6\u7ec6\u8bf4\u660e\u4e86\u5b9e\u73b0\u8df3\u52a8\u7231\u5fc3\u6240\u9700\u7684\u6280\u672f\uff0c\u5305\u62ec\u56fe\u5f62\u5e93\u7684\u4f7f\u7528\u3001\u6570\u5b66\u516c\u5f0f\u7684\u5e94\u7528\u3001\u968f\u673a\u6570\u751f\u6210\u548c\u52a8\u753b\u751f\u6210\u7b49\u3002\u63a5\u7740\uff0c\u6587\u7ae0\u63d0\u4f9b\u4e86\u5b8c\u6574\u4ee3\u7801\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u4e86\u8be6\u7ec6\u5206\u6790\uff0c\u89e3\u91ca\u4e86\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684\u6570\u636e\u7ed3\u6784\u3001\u5e38\u91cf\u58f0\u660e\u3001\u51fd\u6570\u5b9e\u73b0\u548c\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b\u3002\u6700\u540e\uff0c\u6587\u7ae0\u603b\u7ed3\u4e86\u4ee3\u7801\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u5373\u901a\u8fc7\u9010\u5e27\u7ed8\u5236\u751f\u6210\u52a8\u6001\u5fc3\u5f62\u56fe\u6848\uff0c\u5c55\u793a\u4e86C++\u5728\u56fe\u5f62\u5904\u7406\u548c\u52a8\u753b\u5236\u4f5c\u4e2d\u7684\u5f3a\u5927\u80fd\u529b\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/39936.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-26T05:57:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250526055711-683402b72add7.gif\" \/>\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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39936.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/39936.html\",\"name\":\"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-26T05:57:13+00:00\",\"dateModified\":\"2025-05-26T05:57:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/39936.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/39936.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39936.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3\"}]},{\"@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\/C++\u8df3\u52a8\u7684\u7231\u5fc3 - \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\/39936.html","og_locale":"zh_CN","og_type":"article","og_title":"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1w\u6b21\uff0c\u70b9\u8d5e52\u6b21\uff0c\u6536\u85cf66\u6b21\u3002\u8fd9\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528C\/C++\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u674e\u5ccb\u540c\u6b3e\u8df3\u52a8\u7684\u7231\u5fc3\u52a8\u753b\u6548\u679c\u3002\u6587\u7ae0\u9996\u5148\u6982\u8ff0\u4e86C++\u8bed\u8a00\u5728\u56fe\u5f62\u5904\u7406\u65b9\u9762\u7684\u4f18\u52bf\uff0c\u5e76\u8be6\u7ec6\u8bf4\u660e\u4e86\u5b9e\u73b0\u8df3\u52a8\u7231\u5fc3\u6240\u9700\u7684\u6280\u672f\uff0c\u5305\u62ec\u56fe\u5f62\u5e93\u7684\u4f7f\u7528\u3001\u6570\u5b66\u516c\u5f0f\u7684\u5e94\u7528\u3001\u968f\u673a\u6570\u751f\u6210\u548c\u52a8\u753b\u751f\u6210\u7b49\u3002\u63a5\u7740\uff0c\u6587\u7ae0\u63d0\u4f9b\u4e86\u5b8c\u6574\u4ee3\u7801\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u4e86\u8be6\u7ec6\u5206\u6790\uff0c\u89e3\u91ca\u4e86\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684\u6570\u636e\u7ed3\u6784\u3001\u5e38\u91cf\u58f0\u660e\u3001\u51fd\u6570\u5b9e\u73b0\u548c\u7a0b\u5e8f\u6267\u884c\u6d41\u7a0b\u3002\u6700\u540e\uff0c\u6587\u7ae0\u603b\u7ed3\u4e86\u4ee3\u7801\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u5373\u901a\u8fc7\u9010\u5e27\u7ed8\u5236\u751f\u6210\u52a8\u6001\u5fc3\u5f62\u56fe\u6848\uff0c\u5c55\u793a\u4e86C++\u5728\u56fe\u5f62\u5904\u7406\u548c\u52a8\u753b\u5236\u4f5c\u4e2d\u7684\u5f3a\u5927\u80fd\u529b\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/39936.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-26T05:57:13+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250526055711-683402b72add7.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/39936.html","url":"https:\/\/www.wsisp.com\/helps\/39936.html","name":"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-26T05:57:13+00:00","dateModified":"2025-05-26T05:57:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/39936.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/39936.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/39936.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C\/C++\u8df3\u52a8\u7684\u7231\u5fc3"}]},{"@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\/39936","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=39936"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39936\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/39934"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=39936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=39936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=39936"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=39936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}