{"id":384,"date":"2011-08-08T15:03:00","date_gmt":"2011-08-08T07:03:00","guid":{"rendered":"http:\/\/wangkaixuan.tech\/?p=384"},"modified":"2020-06-06T15:05:04","modified_gmt":"2020-06-06T07:05:04","slug":"%e5%9f%ba%e4%ba%8e%e5%a0%86%e6%a0%88%e7%9a%84%e8%ae%a1%e7%ae%97%e5%99%a8%e5%ae%9e%e7%8e%b0%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.wangkaixuan.tech\/?p=384","title":{"rendered":"\u57fa\u4e8e\u5806\u6808\u7684\u8ba1\u7b97\u5668\u5b9e\u73b0\u7b97\u6cd5"},"content":{"rendered":"\n<p>\u5bf9\u4e8e\u8ba1\u7b97\u5668\uff0c\u6709\u5f88\u591a\u6210\u719f\u7684\u7406\u8bba\u3002\u672c\u6587\u7ae0\u8ba8\u8bba\u7684\u662f\u5229\u7528\u4e00\u4e2a\u64cd\u4f5c\u6570\u5806\u6808\u548c\u4e00\u4e2a\u8fd0\u7b97\u7b26\u5806\u6808\u8fdb\u884c\u8fd0\u7b97\u7684\u65b9\u6cd5\u3002\u8fd9\u79cd\u7b97\u6cd5\u5df2\u7ecf\u6709\u5f88\u5b8c\u5584\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u6b64\u5904\u8ba8\u8bba\u7684\u662f\u6700\u7b80\u5316\u7684\u6a21\u578b\uff0c\u65e8\u5728\u8ba9\u521d\u5b66\u8005\u5728\u6700\u77ed\u7684\u65f6\u95f4\u5185\u5b66\u5230\u6b64\u7b97\u6cd5\u7684\u7cbe\u9ad3\uff0c\u5e76\u80fd\u7075\u6d3b\u7684\u5e94\u7528\u5230\u79d1\u7814\u7684\u4efb\u4f55\u4e00\u4e2a\u9886\u57df\u3002<\/p>\n\n\n\n<p>\u7b80\u5355\u8868\u8fbe\u5f0f\u7684\u8ba1\u7b97<\/p>\n\n\n\n<p>\u9996\u5148\u8bf7\u770b\u8fd9\u4e2a\u8868\u8fbe\u5f0f\uff1a<br>3\uff0b5\uff0b6\uff0a7\uff0a8\uff3e2\uff3e3 \uff088\uff3e2\u6307\u7684\u662f82\uff09<br>\u8fd9\u91cc\u8fd0\u7b97\u6709\u4e09\u79cd\u4f18\u5148\u7ea7\u201c\uff3e\u201d&#8211;\uff1e<br>\u201c\uff0a\u201d&#8211;\uff1e\u201c\uff0b\u201d\uff0c\u3000\u5982\u4f55\u5b9e\u73b0\u4f18\u5148\u7ea7\u8fd0\u7b97\u5462\uff1f<\/p>\n\n\n\n<p>\u5f53\u626b\u63cf\u5b57\u7b26\u4e323\uff0b5\uff0b6\uff0a7\uff0a8\uff3e2\uff3e3\u7684\u65f6\u5019\u3002<\/p>\n\n\n\n<p>1.\u3000\u5148\u79fb\u8fdb3\uff0b5\uff0c\u53d1\u73b0\u4e0b\u4e00\u4e2a\u8fd0\u7b97\u7b26\u662f\uff0b\uff0c\u4f18\u5148\u7ea7\u4e0e\u4e0a\u4e00\u4e2a\u76f8\u540c\uff0c\u4e8e\u662f\u5c31\u5148\u8ba1\u7b973\uff0b5\uff0c\u5c06\u5b83\u4eec\u6539\u4e3a8\u3002\u4e8e\u662f\u5f0f\u5b50\u53d8\u4e3a\uff1a8\uff0b6\uff0a7\uff0a8\uff3e2\uff3e3<br>2.\u3000\u73b0\u5728\u4e0b\u4e00\u8fd0\u7b97\u7b26\uff0a\u4f18\u5148\u7ea7\u6bd4\u4e0a\u4e00\u4e2a\uff0b\u8981\u9ad8\uff0c\u4e8e\u662f\u7ee7\u7eed\u524d\u79fb\uff1a8\uff0b6\uff0a7\uff0a8\uff3e2\uff3e3<br>3.\u3000\u73b0\u5728\u4e0b\u4e00\u4e2a\u8fd0\u7b97\u7b26\u662f\uff0a\uff0c\u4e0e\u4e0a\u4e00\u4e2a\u76f8\u540c\uff0c\u4e8e\u662f\u5148\u8ba1\u7b976\uff0a7\uff0c\u5f0f\u5b50\u53d8\u4e3a\uff1a8\uff0b42\uff0a8\uff3e2\uff3e3<br>4.\u3000\u7ee7\u7eed\uff1a8\uff0b42\uff0a8\uff3e2\uff3e3<br>5.\u30008\uff0b42\uff0a64\uff3e3<br>6.\u30008\uff0b42\uff0a262144<br>7.\u30008\uff0b1\uff0e101\uff0a107<br>8.\u30001\uff0e101\uff0a107<\/p>\n\n\n\n<p>\u73b0\u5728\u5f0f\u5b50\u53d8\u6210\u4e00\u4e2a\u6570\uff0c\u6574\u4e2a\u8fd0\u7b97\u4e5f\u5c31\u7ed3\u675f\u4e86\u3002<\/p>\n\n\n\n<p>\u4f46\u600e\u6837\u5728\u8ba1\u7b97\u673a\u4e2d\u5b8c\u6210\u8fd9\u4e2a\u8fc7\u7a0b\u5462\uff1f\u5f53\u9047\u52308\uff0b6\uff0a7\u65f6\u5fc5\u987b\u5148\u8fd0\u7b976\uff0a7\uff0c\u4f46\u8fd9\u65f68\u548c\uff0b\u4fdd\u5b58\u5728\u54ea\u91cc\u5462\uff1f\u8fd9\u91cc\u4f7f\u7528\u7684\u65b9\u6cd5\u662f\uff1a\u5efa\u7acb\u4e00\u4e2a\u64cd\u4f5c\u6570\u5806\u6808\u548c\u4e00\u4e2a\u8fd0\u7b97\u7b26\u5806\u6808\uff0c\u628a8\u548c\uff0b\u5206\u522b\u538b\u5230\u4e24\u4e2a\u5806\u6808\u4e2d\u3002<br>\u5bf9\u4e8e\u5f0f\u5b50\uff1a3\uff0b5\uff0b6\uff0a7-8\uff3e2<\/p>\n\n\n\n<p>\u5269\u4f59\u5f0f\u5b50 \u64cd\u4f5c\u6570\u5806\u6808 \u8fd0\u7b97\u7b26\u5806\u6808 \u4f18\u5148\u7ea7\u6bd4\u8f83 \u64cd\u4f5c<br>3\uff0b5\uff0b6\uff0a7-8\uff3e2<br>\u00b16\uff0a7-8\uff3e2 3\uff0c5 \u00b1 \u76f8\u7b49 \u8ba1\u7b97 3\uff0b5\uff1d8<br>\uff0b6\uff0a7-8\uff3e2 8<br>\uff0a7-8\uff3e2 8\uff0c6 \u00b1 \u5927\u4e8e<br>-8\uff3e2 8\uff0c6\uff0c7 \uff0b\uff0c\uff0a \u5c0f\u4e8e \u8ba1\u7b976\uff0a7\uff1d42<br>-8\uff3e2 8\uff0c42 \uff0b \u7b49\u4e8e \u8ba1\u7b97 8\uff0b42\uff1d50<br>-8\uff3e2 50<br>\uff3e2 50\uff0c8 &#8211; \u5927\u4e8e<br>50\uff0c8\uff0c2 -\uff0c\uff3e \u8ba1\u7b978\uff3e2\uff1d64<br>50\uff0c64 &#8211; \u8ba1\u7b97 50-64\uff1d-14<br>-14 \uff3e<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u53ef\u4ee5\u770b\u51fa\uff0c\u5982\u679c\u5229\u7528\u64cd\u4f5c\u6570\u5806\u6808\u548c\u8fd0\u7b97\u7b26\u5806\u6808\u7684\u8bdd\uff0c\u53ea\u8981\uff1a<br>1\uff0e\u3000\u6b65\u8fdb\u626b\u63cf\u8868\u8fbe\u5f0f\u3002<br>2\uff0e\u3000\u9047\u5230\u64cd\u4f5c\u6570\u5c31\u538b\u5165\u64cd\u4f5c\u6570\u5806\u6808\u4e2d\uff0c\u9047\u5230\u8fd0\u7b97\u7b26\u5c31\u5c06\u5b83\u7684\u4f18\u5148\u7ea7\u4e0e\u8fd0\u7b97\u7b26\u5806\u6808\u6808\u9876\u8fd0\u7b97\u7b26\u7684\u4f18\u5148\u7ea7\u6bd4\u8f83\uff0c\u5982\u679c\u5b83\u7684\u4f18\u5148\u7ea7\u66f4\u5927\uff0c\u5c31\u5c06\u5b83\u538b\u5165\u5806\u6808\uff0c\u5426\u5219\u5c31\u5c06\u6808\u9876\u8fd0\u7b97\u7b26\u5f39\u51fa\u6765\u8fdb\u884c\u8fd0\u7b97\u3002<br>\u53ea\u8981\u8fd9\u6837\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4f18\u5148\u7ea7\u7684\u8fd0\u7b97\u3002<\/p>\n\n\n\n<p>\u4f18\u5148\u7ea7\u7684\u6539\u53d8<\/p>\n\n\n\n<p>\u5728\u6211\u7684\u793a\u4f8b\u7a0b\u5e8f\u4e2d\u89c4\u5b9a\u4e863\u79cd\u4f18\u5148\u7ea7<\/p>\n\n\n\n<p>\uff0b\u3001-\u3001\u81ea\u53cd\u8fd0\u7b97\uff08-x\uff0c-y\uff0c-z\uff0c-1\uff0c-2\uff09 \uff1a\u4f18\u5148\u7ea7\u4e3a<br>1\uff08\u8f83\u4f4e\uff09<br>\uff0a\u3001\uff0f\u3000\uff1a\u4f18\u5148\u7ea7\u4e3a2<br>\uff3e \uff1a\u4f18\u5148\u7ea7\u4e3a3\uff08\u6700\u9ad8\uff09<\/p>\n\n\n\n<p>\u4f46\u201c\uff08\u201d\u7684\u4f18\u5148\u7ea7\u5e94\u8be5\u662f\u591a\u5c11\uff0c\u62ec\u53f7\u6307\u7684\u662f\u5f00\u59cb\u4e00\u4e2a\u65b0\u7684\u8fd0\u7b97\uff0c\u5bf9\u4e8e3\uff0b5\uff0a\uff086-2\uff09\uff0c\u5f53\u626b\u63cf\u5230\u201c\uff08\u201d\u65f6\uff0c\u539f\u5148\u7684<br>\u4f18\u5148\u7ea7\u5c31\u5168\u90e8\u5931\u6548\u4e86\uff0c\u4e00\u5207\u9700\u8981\u91cd\u65b0\u8ba1\u7b97\uff0c\u56e0\u6b64\u626b\u63cf\u65f6\u9047\u5230\u201c\uff08\u201d\uff0c\u5c31\u5c06\u5b83\u65e0\u6761\u4ef6\u538b\u5165\u6808\u4e2d\uff0c\u540c\u65f6\u7f6e\u6700\u4f4e\u4f18\u5148\u7ea7-<br>1\u3002\u4e0e\u6b64\u64cd\u4f5c\u76f8\u540c\u7684\u8fd8\u6709\u3000\u201csin\uff08\u201d\u3001\u201ccos\uff08\u201d\u3001\u201ctan\uff08\u201d\u3001\u201ctg\uff08\u201d\u3001\u201clg\uff08\u201d\u3001\u201cln\uff08\u201d\u7b49.<br>\u9047\u5230\u201c\uff09\u201d\uff0c\u5c31\u5e94\u8be5\u4e0d\u505c\u51fa\u6808\u8fd0\u7b97\u76f4\u81f3\u627e\u5230\u201c\uff08\u201d\u3001\u201csin\uff08\u201d\u3001\u201ccos\uff08\u201d\u3001\u201ctan\uff08\u201d\u3001\u201ctg\uff08\u201d\u3001\u201clg\uff08\u201d\u3001\u201cln\uff08\u201d\u7b49\u3002<\/p>\n\n\n\n<p>\u7a0b\u5e8f\u6d41\u7a0b<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u5408\u6cd5\u7684\u7b80\u5355\u6570\u5b66\u8868\u8fbe\u5f0f\uff0c\u80af\u5b9a\u662f\u4e00\u4e2a\u64cd\u4f5c\u6570\u8ddf\u7740\u4e00\u4e2a\u8fd0\u7b97\u7b26\uff0c\u7b2c\u4e00\u4e2a\u548c\u6700\u540e\u4e00\u4e2a\u90fd\u662f\u64cd\u4f5c\u6570\u3002\u56e0\u6b64\u6700\u7b80\u5355\u7684\u7a0b\u5e8f\u7f16\u5199\u65b9\u6cd5\u5c31\u662f\u5199\u4e00\u4e2a\u53d6\u64cd\u4f5c\u6570\u7684\u7a0b\u5e8fCCalc\uff1a\uff1aGetOperand\uff08\uff09\uff0c\u518d\u5199\u4e00\u4e2a\u53d6\u8fd0\u7b97\u7b26\u7684\u7a0b\u5e8fCCalc\uff1a\uff1aGetOperator\uff08\uff09\uff0c\u7136\u540e\u5faa\u73af\u6267\u884c\u3002<\/p>\n\n\n\n<p>while(!GetOperand()&amp;&amp;!GetOperator()&amp;&amp;!vError);<\/p>\n\n\n\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u8ba1\u7b97\u51fa\u6700\u7ec8\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>1\uff0e\u3000\u53d6\u64cd\u4f5c\u6570GetOperand\uff08\uff09\uff1a<br>\uff081\uff09\u53d6\u64cd\u4f5c\u6570\u65f6\u9996\u5148\u9047\u5230\u7684\u4e0d\u4e00\u5b9a\u5c31\u662f\u64cd\u4f5c\u6570\u672c\u8eab\uff0c\u800c\u53ef\u80fd\u662f\u201c\uff08\u201d\u3001\u201csin\uff08\u201d\u3001\u201ccos\uff08\u201d\u3001\u201ctan\uff08\u201d\u3001\u201ctg\uff08\u201d\u3001\u201clg\uff08\u201d\u3001\u201cln\uff08\u201d\u6216\u81ea\u53cd\u8fd0\u7b97\u7b26\u201c-\u201d\u6216\u65e0\u610f\u4e49\u7684\u201c\uff0b\u201d\u53f7\uff0c\u9996\u5148\u5c06\u5b83\u4eec\u538b\u5165\u8fd0\u7b97\u7b26\u6808\u4e2d\u3002<br>\uff082\uff09\u7136\u540e\u68c0\u67e5\u662f\u4e0d\u662f\u201cx\u201d\u3001\u201cy\u201d\u3001\u201cz\u201d\u7b49\u53d8\u91cf\u6216\u201cPI\u201d\u7b49\u5e38\u91cf\uff0c\u6709\u7684\u8bdd\u5c06\u5b83\u4eec\u7684\u503c\u538b\u5230\u64cd\u4f5c\u6570\u6808\u4e2d\u3002<br>\uff083\uff09\u5982\u679c\u4e0d\u662f\u53d8\u91cf\u6216\u5e38\u91cf\uff0c\u5219\u68c0\u67e5\u6570\u7684\u5408\u6cd5\u6027\uff0c\u5982\u679c\u4e0d\u662f\u5408\u6cd5\u6570\uff0c\u5c31\u9000\u51fa\u5168\u90e8\u8fd0\u7b97\u3002<\/p>\n\n\n\n<p>2\uff0e\u53d6\u8fd0\u7b97\u7b26GetOperator\uff08\uff09\uff1a<br>\uff081\uff09\u53d6\u8fd0\u7b97\u7b26\u65f6\u9996\u5148\u9047\u5230\u7684\u4e0d\u4e00\u5b9a\u5c31\u662f\u8fd0\u7b97\u7b26\uff0c\u800c\u53ef\u80fd\u662f\u201c\uff09\u201d\uff0c\u5148\u8981\u5bf9\u5b83\u8fdb\u884c\u5904\u7406\u3002<br>\uff082\uff09\u7136\u540e\u68c0\u67e5\u662f\u4e0d\u662f\u626b\u63cf\u5230\u4e86\u6700\u540e\uff0c\u5982\u679c\u662f\u5c31\u6e05\u6808\u8f93\u51fa\u7ed3\u679c\u3002<br>\uff083\uff09\u53d6\u51fa\u65b0\u8fd0\u7b97\u7b26\u5e76\u7ed9\u5b83\u5bf9\u5e94\u7684\u4f18\u5148\u7ea7\u3002<br>\uff084\uff09\u5982\u679c\u8fd0\u7b97\u7b26\u5806\u6808\u4e0d\u4e3a\u7a7a\uff0c\u4ece\u4e2d\u5f39\u51fa\u4e00\u4e2a\u8fd0\u7b97\u7b26\uff0c\u6bd4\u8f83\u4f18\u5148\u7ea7\uff0c\u5982\u679c\u65b0\u7684\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7\u5c0f\u4e8e\u7b49\u4e8e\u5f39\u51fa\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7\uff0c\u5c31\u628a\u5f39\u51fa\u8fd0\u7b97\u7b26\u91cd\u65b0\u538b\u56de\u53bb\uff0c\u5426\u5219\u5bf9\u5f39\u51fa\u8fd0\u7b97\u7b26\u8fdb\u884c\u8fd0\u7b97\u3002<br>\uff085\uff09\u5c06\u65b0\u8fd0\u7b97\u7b26\u538b\u5165\u5806\u6808\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9\u4e8e\u8ba1\u7b97\u5668\uff0c\u6709\u5f88\u591a\u6210\u719f\u7684\u7406\u8bba\u3002\u672c\u6587\u7ae0\u8ba8\u8bba\u7684\u662f\u5229\u7528\u4e00\u4e2a\u64cd\u4f5c\u6570\u5806\u6808\u548c\u4e00\u4e2a\u8fd0\u7b97\u7b26\u5806\u6808\u8fdb\u884c\u8fd0\u7b97\u7684\u65b9\u6cd5\u3002\u8fd9\u79cd\u7b97\u6cd5\u5df2\u7ecf\u6709\u5f88\u5b8c\u5584\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u6b64\u5904\u8ba8\u8bba\u7684\u662f\u6700\u7b80\u5316\u7684\u6a21\u578b\uff0c\u65e8\u5728\u8ba9\u521d&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"http:\/\/www.wangkaixuan.tech\/?p=384\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-384","post","type-post","status-publish","format-standard","hentry","category-06-03-play-ground"],"_links":{"self":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=384"}],"version-history":[{"count":0,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/384\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=384"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}