{"id":363,"date":"2023-10-15T11:17:46","date_gmt":"2023-10-15T03:17:46","guid":{"rendered":"https:\/\/wp.minicoda.com\/?p=363"},"modified":"2025-03-01T07:56:08","modified_gmt":"2025-02-28T23:56:08","slug":"%e8%be%93%e5%85%a5","status":"publish","type":"post","link":"https:\/\/wp.minicoda.com\/index.php\/%e8%be%93%e5%85%a5\/","title":{"rendered":"\u8f93\u5165"},"content":{"rendered":"\n<p>  \u7f16\u7a0b\u8bed\u8a00\u63d0\u4f9b\u6700\u57fa\u672c\u7684\u8f93\u5165\u8f93\u51fa\uff0c\u8f93\u5165\u4e00\u4e2a\u9884\u671f\u7684\u6570\u636e\u4e5f\u4e0d\u662f\u770b\u8d77\u6765\u90a3\u4e48\u7b80\u5355\uff0c\u5982\u4e0b\u4e00\u4e00\u5c55\u5f00\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0d\u540c\u8f93\u5165\u5f62\u5f0f<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u8bed\u8a00scanf\u63d0\u4f9b\u683c\u5f0f\u4e32\u8f93\u5165\uff0c\u7a0b\u5e8f\u5458\u8d1f\u8d23\u914d\u7f6e\u6b63\u786e\u7684\u683c\u5f0f\uff0c\u6bd4\u5982%d\u6574\u578b\uff0c%s\u4e3a\u5b57\u7b26\u4e32\u3002\u53ef\u80fd\u51fa\u73b0\u683c\u5f0f\u4e32\u548c\u53d8\u91cf\u683c\u5f0f\u3001\u4e2a\u6570\u4e0d\u5b8c\u5168\u5339\u914d\uff0c\u8f93\u5165\u7684\u6570\u636e\u5f02\u5e38\u3001\u9519\u4f4d\u3002\u4f46\uff0c\u56e0\u4e3a\u53c2\u6570\u662f\u503c\u4f20\u9012\uff0c\u53d8\u91cf\u5fc5\u987b\u53d6\u5730\u5740\u4f20\u5165\uff0c\u624d\u80fd\u6b63\u786e\u66f4\u65b0\u3002<\/li>\n\n\n\n<li>C++\u5f15\u5165\u4e86cin\u6807\u51c6\u8f93\u5165\u6d41\u5bf9\u8c61\uff0c\u4f7f\u7528&gt;&gt;\u8fd0\u7b97\u7b26\u548c\u53d8\u91cf\u5373\u53ef\uff0c\u6ce8\u610f\u53d8\u91cf\u4e0d\u7528\u53d6\u5730\u5740\uff0c\u5229\u7528\u4e86\u5f15\u7528\u6982\u5ff5\uff0c\u4ee3\u7801\u8212\u9002\u5ea6\u8f83\u9ad8\u3002<\/li>\n\n\n\n<li>Java\u9700\u8981\u989d\u5916\u521b\u5efaScanner\u5bf9\u8c61\uff0c\u663e\u5f97\u9ebb\u70e6\u3002<\/li>\n\n\n\n<li>Python\u63d0\u4f9binput\u51fd\u6570\u8f93\u5165\uff0c\u672c\u8eab\u5c5e\u4e8e\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u8fd4\u56de\u503c\u7c7b\u578b\u4e3a\u5b57\u7b26\u4e32\uff0c\u8f93\u5165\u7684\u53d8\u91cf\u53ef\u4ee5\u88ab\u8f6c\u6362\u6210\u7b26\u5408\u8981\u6c42\u7684\u683c\u5f0f\uff0c\u6bd4\u5982\u7528int\u51fd\u6570\u8f6c\u6362\u4e3a\u6574\u6570\u3002<\/li>\n\n\n\n<li>\u5176\u4ed6\u811a\u672c\u8bed\u8a00\u7528\u6cd5\u4e00\u822c\u90fd\u6bd4\u8f83\u7b80\u5355\uff0c\u6bd4\u5982read\u6216input\u5373\u53ef\u8f93\u5165\u3002<\/li>\n\n\n\n<li>Pascal\u7684\u8f93\u5165\u5f88\u7b80\u5355\uff0c\u7528Read\u6216Readln\u5373\u53ef(\u540e\u8005\u548c\u524d\u8005\u533a\u522b\u662f\u5426\u8bfb\u53d6\u4e00\u6574\u884c\uff0c\u591a\u6b21\u8c03\u7528Readln\u548c\u591a\u6b21\u8c03\u7528Read\u662f\u6709\u533a\u522b\u7684)\uff0c\u591a\u4e2a\u53d8\u91cf\u53ef\u4ee5\u76f4\u63a5\u653e\u5165\u53c2\u6570\u3002\u4f8b\u5982\uff1a<br>Read(a, b, c);<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e26\u989d\u5916\u5b57\u7b26\u7684\u8f93\u5165<\/h3>\n\n\n\n<p>  \u989d\u5916\u5b57\u7b26\u6709\u5206\u9694\u4f5c\u7528\uff0c\u5bf9\u4e8e\u8f93\u5165\u53cd\u800c\u4f1a\u4ea7\u751f\u8bef\u89e3\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u8bed\u8a00scanf(\u201c%d,%d\u201d, &amp;a, &amp;b)\u9700\u8981\u8f93\u5165\u201d,\u201d\u624d\u80fd\u6b63\u5e38\u89e3\u6790\u3002\u5c31\u50cf\u53bb\u94f6\u884c\u529e\u4e1a\u52a1\u7533\u8bf7\u8868\u5355\u6709\u81ea\u5df1\u7684\u683c\u5f0f\uff0c\u7b26\u5408\u683c\u5f0f\u624d\u80fd\u529e\u6210\u529f\u3002<\/li>\n\n\n\n<li>C#\u6ca1\u6709C\u8bed\u8a00\u7b80\u6d01\uff0c\u9700\u8981\u7528Split\u65b9\u6cd5\u622a\u65ad\uff1aConsole.ReadLine().Split(',').<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u4e0d\u6210\u529f<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u8bed\u8a00\u683c\u5f0f\u548c\u8f93\u5165\u6570\u636e\u4e0d\u5339\u914d\uff0c\u5c5e\u4e8e\u9519\u8bef\uff0c\u5f53\u524d\u53d8\u91cf\u7684\u6570\u503c\u4e0d\u786e\u5b9a\uff0c\u8f93\u5165\u7f13\u51b2\u533a\u6570\u636e\u88ab\u4fdd\u7559\u7ed9\u4e0b\u4e00\u4e2a\u683c\u5f0f\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u5728\u540c\u4e00\u5957\u8fd0\u884c\u65f6\uff0c\u4e0d\u540c\u8f93\u5165\u51fd\u6570\u5171\u4eab\u8f93\u5165\u7f13\u51b2\u533a\uff0c\u5982\u679c\u524d\u9762\u51fd\u6570\u8f93\u5165\u4e0d\u6210\u529f\uff0c\u7f13\u51b2\u533a\u6570\u636e\u4f1a\u4fdd\u7559\u7ed9\u4e0b\u4e00\u4e2a\u8f93\u5165\u51fd\u6570\uff0c\u4f8b\u5982C\u8bed\u8a00scanf\u548cgetchar\uff0c\u5982scanf\u6267\u884c\u540e\u8fd8\u5269\u4e0b\u5b57\u7b26\u672a\u5904\u7406\uff0c\u63a5\u4e0b\u6765getchar\u51fd\u6570\u4f1a\u7ee7\u7eed\u7528\u5230\u524d\u9762\u7684\u5b57\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u7684\u5ffd\u7565\u5b57\u7b26<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>scanf\u9ed8\u8ba4\u4f1a\u5ffd\u7565\u4efb\u4f55\u7a7a\u767d\u5b57\u7b26(\u6362\u884c\u3001\u7a7a\u683c\u3001\u5236\u8868\u7b26)\uff0c\u54ea\u6015\u662f%c\u683c\u5f0f\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u3002<\/li>\n\n\n\n<li>getchar\u51fd\u6570\u4e0d\u4f1a\u5ffd\u7565\u7a7a\u767d\u5b57\u7b26\uff0c\u8fd9\u53ef\u80fd\u9020\u6210\u67d0\u4e9b\u65f6\u5019\u4e00\u4e9b\u4e0d\u9884\u671f\u5b57\u7b26\u7684\u95ee\u9898\uff0c\u9700\u8981\u683c\u5916\u6ce8\u610f\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u9700\u8981\u56de\u8f66\u7b26\u624d\u80fd\u63a5\u6536\u5b57\u7b26?<\/h3>\n\n\n\n<p>  \u4e00\u822c\u800c\u8a00\uff0c\u6807\u51c6\u8f93\u5165\u662f\u884c\u7f13\u51b2\uff0c\u5f53\u6ca1\u6709\u6309\u56de\u8f66\u7b26\u4e4b\u524d\uff0c\u6240\u6709\u7684\u8f93\u5165\u90fd\u5728\u7f13\u51b2\u533a\u4e2d\uff0c\u4e0d\u4f1a\u6295\u9012\u7ed9\u7a0b\u5e8f\u8f93\u5165\u3002\u4e0d\u8981\u88ab\u8f93\u5165\u65f6\u4f1a\u56de\u663e\u6df7\u6dc6\uff0c\u5b83\u53ea\u662f\u7ec8\u7aef\u4e3a\u4e86\u8ba9\u4f7f\u7528\u8005\u6e05\u695a\u8f93\u5165\u4e86\u4ec0\u4e48\uff0c\u53ea\u662f\u4e14\u4ec5\u4ec5\u4e3a\u4e86\u663e\u793a\u51fa\u6765\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C# Console.Read() \u65b9\u6cd5\u5728\u6ca1\u6709\u8f93\u5165\u56de\u8f66\u4e4b\u524d\uff0c\u5df2\u8f93\u5165\u7684\u5b57\u7b26\u90fd\u4e0d\u4f1a\u88ab\u5904\u7406\u3002C# 2.0\u5f15\u5165Console.ReadKey() \u65b9\u6cd5\uff0c\u5b83\u548c\u524d\u9762\u4e0d\u540c\uff0c\u4f1a\u5373\u65f6\u53cd\u9988\u8f93\u5165\u7684\u5b57\u7b26\uff0c\u4e0d\u9700\u8981\u6309\u56de\u8f66\u6309\u952e\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u5168\u7684\u8f93\u5165<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u8bed\u8a00\u7684scanf\u5bf9\u7f13\u51b2\u533a\u9650\u5236\u5f88\u5c0f\uff0c\u663e\u7136\u5bb9\u6613\u9020\u6210\u4e00\u4e9b\u6f0f\u6d1e\u3002\n<ul class=\"wp-block-list\">\n<li>scanf_s \u662fMicrosoft \u7279\u5b9a\u7684\u6269\u5c55\uff0c\u589e\u52a0\u4e86\u989d\u5916\u7684\u7f13\u51b2\u533a\u5927\u5c0f\u9650\u5b9a\u4e0d\u4f1a\u8d85\u51fa\u9650\u5236\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u7f16\u7a0b\u8bed\u8a00\u63d0\u4f9b\u6700\u57fa\u672c\u7684\u8f93\u5165\u8f93\u51fa\uff0c\u8f93\u5165\u4e00\u4e2a\u9884\u671f\u7684\u6570\u636e\u4e5f\u4e0d\u662f\u770b\u8d77\u6765\u90a3\u4e48\u7b80\u5355\uff0c\u5982\u4e0b\u4e00\u4e00\u5c55\u5f00\u3002 \u4e0d\u540c\u8f93\u5165\u5f62\u5f0f \u5e26\u989d\u5916\u5b57\u7b26\u7684\u8f93\u5165 \u989d\u5916\u5b57\u7b26\u6709\u5206\u9694\u4f5c\u7528\uff0c\u5bf9\u4e8e\u8f93\u5165\u53cd\u800c\u4f1a\u4ea7\u751f\u8bef\u89e3\u3002 \u8f93\u5165\u4e0d\u6210\u529f \u8f93\u5165\u7684\u5ffd\u7565\u5b57\u7b26 \u8f93\u5165\u9700\u8981&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,128],"tags":[9,129],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-8","category-128","tag-9","tag-129"],"views":89,"_links":{"self":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/comments?post=363"}],"version-history":[{"count":12,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":3777,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/363\/revisions\/3777"}],"wp:attachment":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/media?parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/categories?post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/tags?post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}