{"id":61,"date":"2026-08-30T10:00:00","date_gmt":"2026-08-30T02:00:00","guid":{"rendered":"https:\/\/decagrammaton.xyz\/?p=61"},"modified":"2026-09-12T10:01:56","modified_gmt":"2026-09-12T02:01:56","slug":"61","status":"publish","type":"post","link":"https:\/\/decagrammaton.xyz\/?p=61","title":{"rendered":"04-\u5224\u65ad\u5faa\u73af\u63a7\u5236\u8bed\u53e5"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5224\u65ad<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528if\u505a\u5224\u65ad<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">if\u8bed\u53e5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4f8b<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb1\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb1-1\"><a href=\"#cb1-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb1-2\"><a href=\"#cb1-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(){<\/span><\/span>\n<span id=\"cb1-3\"><a href=\"#cb1-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>\u8868\u8fbe\u5f0f<span class=\"op\">){<\/span><\/span>\n<span id=\"cb1-4\"><a href=\"#cb1-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb1-5\"><a href=\"#cb1-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"op\">}<\/span><span class=\"cf\">else<\/span><span class=\"op\">{<\/span><\/span>\n<span id=\"cb1-6\"><a href=\"#cb1-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb1-7\"><a href=\"#cb1-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"op\">}<\/span><\/span>\n<span id=\"cb1-8\"><a href=\"#cb1-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb1-9\"><a href=\"#cb1-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d41\u7a0b\u56fe\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"686\" src=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178365-ifliuch-1024x686.png\" alt=\"\" class=\"wp-image-63\" srcset=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178365-ifliuch-1024x686.png 1024w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178365-ifliuch-300x201.png 300w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178365-ifliuch-768x515.png 768w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178365-ifliuch.png 1455w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">if<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd8\u6709\u4e00\u4e2a\u662fswitch case\u8bed\u53e5(\u4f46\u662f\u66f4\u591a\u662f\u53bb\u505a\u591a\u8def\u5206\u652f\u8fd9\u91cc\u5148\u4e0d\u8bb2)<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5faa\u73af<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">while \u8bed\u53e5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u548cif\u76f8\u4f3c\uff0c\u5f53\u6761\u4ef6\u6ee1\u8db3\u5c31\u4e0d\u65ad\u505a\u540e\u9762\u5927\u62ec\u53f7\u7684\u53e5\u5b50<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4f8b<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb2\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb2-1\"><a href=\"#cb2-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb2-2\"><a href=\"#cb2-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(){<\/span><\/span>\n<span id=\"cb2-3\"><a href=\"#cb2-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">while<\/span><span class=\"op\">(<\/span>\u8868\u8fbe\u5f0f<span class=\"op\">){<\/span><\/span>\n<span id=\"cb2-4\"><a href=\"#cb2-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb2-5\"><a href=\"#cb2-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"op\">}<\/span><\/span>\n<span id=\"cb2-6\"><a href=\"#cb2-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb2-7\"><a href=\"#cb2-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d41\u7a0b\u56fe\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"686\" src=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178371-whileliuch-1024x686.png\" alt=\"\" class=\"wp-image-64\" srcset=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178371-whileliuch-1024x686.png 1024w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178371-whileliuch-300x201.png 300w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178371-whileliuch-768x515.png 768w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178371-whileliuch.png 1455w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">while<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u8981\u6709\u8c03\u6574\u624d\u80fd\u8df3\u51fa\u5faa\u73af\uff0c\u5426\u5219\u4f1a\u8fdb\u5165\u6b7b\u5faa\u73af\uff08\u6761\u4ef6\u6210\u7acb\u4f1a\u8fdb\u5165\u6761\u4ef6\u5faa\u73af\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">do-while \u8bed\u53e5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u505a\u5faa\u73af\u7136\u540e\u518d\u53bb\u5224\u65ad<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4f8b<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb3\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb3-1\"><a href=\"#cb3-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb3-2\"><a href=\"#cb3-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(){<\/span><\/span>\n<span id=\"cb3-3\"><a href=\"#cb3-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">do<\/span><span class=\"op\">{<\/span><\/span>\n<span id=\"cb3-4\"><a href=\"#cb3-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb3-5\"><a href=\"#cb3-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"op\">}<\/span><span class=\"cf\">while<\/span><span class=\"op\">(<\/span>\u8868\u8fbe\u5f0f<span class=\"op\">);<\/span><\/span>\n<span id=\"cb3-6\"><a href=\"#cb3-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb3-7\"><a href=\"#cb3-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d41\u7a0b\u56fe\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"848\" height=\"975\" src=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178378-dowhileliuch.png\" alt=\"\" class=\"wp-image-65\" srcset=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178378-dowhileliuch.png 848w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178378-dowhileliuch-261x300.png 261w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178378-dowhileliuch-768x883.png 768w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" \/><figcaption class=\"wp-element-caption\">do-while<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">do-while\u4f1a\u5148\u6267\u884c\u5faa\u73af\u4ee3\u7801\u540e\u53bb\u5224\u65ad\u6761\u4ef6<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">for \u5faa\u73af<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">for\u5faa\u73af\u50cf\u4e00\u4e2a\u8ba1\u6570\u5faa\u73af\uff1a\u8bbe\u5b9a\u4e00\u4e2a\u8ba1\u7b97\u5668\uff0c\u521d\u59cb\u5316\u5b83\uff0c\u7136\u540e\u5728\u8ba1\u7b97\u5668\u5230\u8fbe\u67d0\u503c\u4e4b\u524d\uff0c\u91cd\u590d\u6267\u884c\u5faa\u73af\u4f53\uff0c\u800c\u6bcf\u6267\u884c\u4e00\u8f6e\u5faa\u73af\uff0c\u8ba1\u7b97\u5668\u503c\u4ee5\u4e00\u5b9a\u6b65\u8fdb\u8fdb\u884c\u8c03\u6574<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4f8b<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb4\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb4-1\"><a href=\"#cb4-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb4-2\"><a href=\"#cb4-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(){<\/span><\/span>\n<span id=\"cb4-3\"><a href=\"#cb4-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">for<\/span><span class=\"op\">(<\/span>\u521d\u59cb\u6761\u4ef6<span class=\"op\">;<\/span>\u5faa\u73af\u6761\u4ef6<span class=\"op\">;<\/span>\u5faa\u73af\u52a8\u4f5c<span class=\"op\">){<\/span><\/span>\n<span id=\"cb4-4\"><a href=\"#cb4-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb4-5\"><a href=\"#cb4-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"op\">}<\/span><\/span>\n<span id=\"cb4-6\"><a href=\"#cb4-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb4-7\"><a href=\"#cb4-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d41\u7a0b\u56fe\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"1024\" src=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178389-forliuch-557x1024.jpg\" alt=\"\" class=\"wp-image-66\" srcset=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178389-forliuch-557x1024.jpg 557w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178389-forliuch-163x300.jpg 163w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178389-forliuch-768x1411.jpg 768w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178389-forliuch-836x1536.jpg 836w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178389-forliuch.jpg 925w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><figcaption class=\"wp-element-caption\">for<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">switch-case \u591a\u8def\u5206\u652f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Switch\n\u53ef\u770b\u4f5c\u4e00\u79cd\u57fa\u4e8e\u8ba1\u7b97\u7684\u8df3\u8f6c\uff0c\u8ba1\u7b97\u63a7\u5236\u8868\u8fbe\u5f0f\u7684\u503c\u540e\uff0c\u7a0b\u5e8f\u4f1a\u8df3\u8f6c\u76f8\u5339\u914d\u7684\ncase\uff08\u5206\u652f\u6807\u53f7\uff09\u5904\uff0c\u5728\u6267\u884c\u5b8c\u6700\u540e\u4e00\u6761\u8bed\u53e5\u540e\uff0c\u5982\u679c\u540e\u65b9\u65e0\nbreak\uff0c\u5219\u4f1a\u987a\u5e8f\u6267\u884c\u5230\u4e0b\u9762\u7684 case \u91cc\u53bb\uff0c\u76f4\u5230\u9047\u5230\u4e00\u4e2a break \u6216 switch\n\u7ed3\u675f\u4e3a\u6b62\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 switch \u91cc\u7684\u6240\u6709\u53e5\u5b50\u5b83\u4eec\u5904\u5728\u540c\u4e00\u7a7a\u95f4\u4e2d\uff0c\u53ef\u65e0\u89c6\u6240\u6709\ncase\uff0c\u5c06\u5176\u8ba4\u4f5c\u662f\u4e00\u4e2a\u8fde\u7eed\u6267\u884c\u7684\u8bed\u53e5\u7684\u5e8f\u5217\uff0c\u53ea\u662f\u5f53\u51fa\u73b0 break\n\u65f6\u4f1a\u6253\u65ad\u5f53\u524d\u8bed\u53e5\u7684\u5e8f\u5217\u3002 case \u5219\u662f\u51b3\u5b9a\u4ece\u54ea\u91cc\u5f00\u59cb\u505a\u4e8b\uff08\u6267\u884c\uff09\u7684\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4f8b<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb5\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb5-1\"><a href=\"#cb5-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb5-2\"><a href=\"#cb5-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(){<\/span><\/span>\n<span id=\"cb5-3\"><a href=\"#cb5-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">switch<\/span><span class=\"op\">(<\/span>\u63a7\u5236\u8868\u8fbe\u5f0f<span class=\"op\">){<\/span><\/span>\n<span id=\"cb5-4\"><a href=\"#cb5-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">case<\/span> \u5e38\u91cf<span class=\"dv\">1<\/span><span class=\"op\">:<\/span><\/span>\n<span id=\"cb5-5\"><a href=\"#cb5-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>      <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb5-6\"><a href=\"#cb5-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">case<\/span> \u5e38\u91cf<span class=\"dv\">2<\/span><span class=\"op\">:<\/span><\/span>\n<span id=\"cb5-7\"><a href=\"#cb5-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>      <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb5-8\"><a href=\"#cb5-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">default<\/span><span class=\"op\">:<\/span><\/span>\n<span id=\"cb5-9\"><a href=\"#cb5-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>      <span class=\"co\">\/\/\u8bed\u53e5<\/span><\/span>\n<span id=\"cb5-10\"><a href=\"#cb5-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"op\">}<\/span><\/span>\n<span id=\"cb5-11\"><a href=\"#cb5-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>  <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb5-12\"><a href=\"#cb5-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u63a7\u5236<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">break<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6c38\u4e45\u505c\u6b62\u5f53\u524d\u5faa\u73af<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">continue<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5faa\u73af\u4e2d\u610f\u5473\u7740\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b21\u5faa\u73af<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u4eec\u7684\u6d41\u7a0b\u56fe\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"1024\" src=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178400-breakvscontinue-605x1024.png\" alt=\"\" class=\"wp-image-67\" srcset=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178400-breakvscontinue-605x1024.png 605w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178400-breakvscontinue-177x300.png 177w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178400-breakvscontinue-768x1301.png 768w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178400-breakvscontinue.png 858w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><figcaption class=\"wp-element-caption\">breakvscontinue<\/figcaption><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u7ec3\u4e60<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u968f\u673a\u6570\u7684\u751f\u6210-\u731c\u6570\u5b57<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">rand(void) \u4f7f\u7528\u4f8b int = rand() \u751f\u6210\u4e00\u4e2a\u968f\u673a\u6570 \u5982\u4f55\u9650\u5236\u5b83\u7684\u8303\u56f4\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u751f\u6210\u4e00\u4e2a1-100\u4e4b\u95f4\uff08\u4e0d\u5305\u62ec100\uff09 int a = rand() % 100<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528a\u53bb\u627f\u63a5\u751f\u6210\u7684\u968f\u673a\u6570 \u53ef\u4ee5\u7528\u8fd9\u4e2a\u6765\u5199\u731c\u6570\u5b57\u7684\u5c0f\u6e38\u620f\u7ec3\u624b\u4e86<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e73\u5747\u6570<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u8bfb\u5165\u4e00\u4e2a\u6570\uff0c\u5c06\u5b83\u52a0\u5165\u5230\u7d2f\u52a0\u7684\u548c\u7684\u53d8\u91cf\uff0c\u4e4b\u540e\u628a\u8f93\u5165\u7684\u503c\u76f8\u52a0\uff0c\u8bfb\u5230\u4e2a\u8d1f\u6570\u4ee3\u8868\u8f93\u5165\u5b8c\u6bd5\uff0c\u4e4b\u540e\u8ba1\u7b97<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d41\u7a0b\u56fe<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"858\" height=\"831\" src=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178402-game1.png\" alt=\"\" class=\"wp-image-68\" srcset=\"https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178402-game1.png 858w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178402-game1-300x291.png 300w, https:\/\/decagrammaton.xyz\/wp-content\/uploads\/2026\/09\/1789178402-game1-768x744.png 768w\" sizes=\"auto, (max-width: 858px) 100vw, 858px\" \/><figcaption class=\"wp-element-caption\">game1<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u6574\u6570\u9006\u5e8f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u4e2a\u6570\u662f\u7531\u591a\u4f4d\u6570\u5b57\u7ec4\u6210\u7684\uff0c\n\u5982\u4f55\u5206\u89e3\u51fa\u6574\u6570\u7684\u5404\u4e2a\u4f4d\u4e0a\u7684\u6570\u5b57\uff0c\u540e\u52a0\u4ee5\u8ba1\u7b97<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e2a\u4f4d\uff1a\u5bf9\u6574\u6570\u505a %10 \u5bf9\u6574\u6570\u505a \/10 \u5341\u4f4d\uff1a\u5bf9\u5bf9\u6574\u6570\u505a \/10 \u505a %10\n\u4f9d\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n<div class=\"tip\">\n<p>\u8f93\u5165\u6570\u5b57\uff08\u6574\u6570\uff09\u6574\u578b\u2460\u53d8\u91cf \u5148\u53d6\u6a21\u5f97\u5230\u4e2a\u4f4d\uff081234%10=1234\/10\u7684\u4f59\u6570\uff09\n\u7528\u4e00\u4e2a\u53d8\u91cf\u5b58\u4e0b\u4e2a\u4f4d\u7684\u503c\u2461=0\n\u5c06\u2460\u540e\u966410\u6765\u51cf\u5c111\u4f4d\u6570\uff081234\/10\u2192123\uff0c\u56e0\u4e3a\u662f\u53d6\u6574\u6570\uff0c\u6240\u4ee54\u88ab\u820d\u5f03\u4e86\uff09\n\u7136\u540e\u628a\u51cf\u5c11\u76841\u4f4d\u6570\u5b57\u7684\u90a3\u4e2a\u6570\u5b58\u56de\u2460\u53d8\u91cf\u91cc\uff08123\u2192x\uff09x=123\n\u5c06\u2460\u7684\u503c\u518d%10\u5f97\u5230\u4e2a\u4f4d\uff0c\uff08123%10\uff09\u21923\n\u6b64\u65f6\u7b2c1\u6b21\u5b58\u4e0b\u7684\u4e4b\u524d\u7684\u503c\u4e5810\u6765\u53d8\u5341\u4f4d\uff0c\u6b64\u6b21\u7684\u503c\u52a0\u5165\uff0c\u6210\u4e3a\u4e2a\u4f4d\uff084\u00d710+3\uff09\u219243\n\u5c06\u2460\/10\u51cf\u4e00\u4f4d\u6570\uff08123%10=12\uff09 \u4f9d\u6b21\u7c7b\u63a8<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u731c\u6570\u5b57\u7b54\u6848<\/h3>\n\n\n\n<div class=\"sourceCode\" id=\"cb6\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb6-1\"><a href=\"#cb6-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb6-2\"><a href=\"#cb6-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdlib.h&gt;<\/span><\/span>\n<span id=\"cb6-3\"><a href=\"#cb6-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;time.h&gt;<\/span><\/span>\n<span id=\"cb6-4\"><a href=\"#cb6-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;windows.h&gt;<\/span><\/span>\n<span id=\"cb6-5\"><a href=\"#cb6-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb6-6\"><a href=\"#cb6-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(<\/span><span class=\"dt\">void<\/span><span class=\"op\">){<\/span><\/span>\n<span id=\"cb6-7\"><a href=\"#cb6-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    srand<span class=\"op\">(<\/span>time<span class=\"op\">(<\/span>NULL<span class=\"op\">));<\/span><\/span>\n<span id=\"cb6-8\"><a href=\"#cb6-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> numb <span class=\"op\">=<\/span> rand<span class=\"op\">()%<\/span><span class=\"dv\">100<\/span><span class=\"op\">+<\/span><span class=\"dv\">1<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb6-9\"><a href=\"#cb6-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">unsigned<\/span> <span class=\"dt\">int<\/span> times <span class=\"op\">=<\/span><span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb6-10\"><a href=\"#cb6-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> enternumber <span class=\"op\">=<\/span><span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb6-11\"><a href=\"#cb6-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">const<\/span> <span class=\"dt\">int<\/span> yuqi <span class=\"op\">=<\/span><span class=\"dv\">7<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb6-12\"><a href=\"#cb6-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u8fd9\u662f\u4e00\u4e2a\u731c\u6570\u5b57\u6e38\u620f<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-13\"><a href=\"#cb6-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-14\"><a href=\"#cb6-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u8303\u56f4\u662f1-100<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-15\"><a href=\"#cb6-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-16\"><a href=\"#cb6-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u51c6\u5907\u597d\u4e86\u5417<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-17\"><a href=\"#cb6-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-18\"><a href=\"#cb6-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"3<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-19\"><a href=\"#cb6-19\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-20\"><a href=\"#cb6-20\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"2<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-21\"><a href=\"#cb6-21\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-22\"><a href=\"#cb6-22\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"1<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-23\"><a href=\"#cb6-23\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-24\"><a href=\"#cb6-24\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u6e38\u620f\u5f00\u59cb\u4e86<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-25\"><a href=\"#cb6-25\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u8bf7\u8f93\u5165\u8fd9\u4e2a\u6570\u5b57<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-26\"><a href=\"#cb6-26\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    scanf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d<\/span><span class=\"st\">\"<\/span><span class=\"op\">,&amp;<\/span>enternumber<span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-27\"><a href=\"#cb6-27\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    times<span class=\"op\">++;<\/span><\/span>\n<span id=\"cb6-28\"><a href=\"#cb6-28\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">do<\/span><\/span>\n<span id=\"cb6-29\"><a href=\"#cb6-29\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">{<\/span><\/span>\n<span id=\"cb6-30\"><a href=\"#cb6-30\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <\/span>\n<span id=\"cb6-31\"><a href=\"#cb6-31\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>enternumber<span class=\"op\">!=<\/span>numb<span class=\"op\">){<\/span><\/span>\n<span id=\"cb6-32\"><a href=\"#cb6-32\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <\/span>\n<span id=\"cb6-33\"><a href=\"#cb6-33\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>enternumber<span class=\"op\">&gt;<\/span>numb<span class=\"op\">){<\/span><\/span>\n<span id=\"cb6-34\"><a href=\"#cb6-34\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        printf<span class=\"op\">(<\/span><span class=\"st\">\"\u4f60\u8f93\u5165\u7684\u6570\u5b57\u5927\u4e86<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-35\"><a href=\"#cb6-35\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        times<span class=\"op\">++;<\/span><\/span>\n<span id=\"cb6-36\"><a href=\"#cb6-36\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        printf<span class=\"op\">(<\/span><span class=\"st\">\"\u8bf7\u518d\u6b21\u8f93\u5165\u8fd9\u4e2a\u6570\u5b57<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-37\"><a href=\"#cb6-37\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        scanf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d<\/span><span class=\"st\">\"<\/span><span class=\"op\">,&amp;<\/span>enternumber<span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-38\"><a href=\"#cb6-38\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb6-39\"><a href=\"#cb6-39\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <\/span>\n<span id=\"cb6-40\"><a href=\"#cb6-40\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span> <span class=\"op\">(<\/span>enternumber<span class=\"op\">&lt;<\/span>numb<span class=\"op\">)<\/span><\/span>\n<span id=\"cb6-41\"><a href=\"#cb6-41\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">{<\/span><\/span>\n<span id=\"cb6-42\"><a href=\"#cb6-42\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>         printf<span class=\"op\">(<\/span><span class=\"st\">\"\u4f60\u8f93\u5165\u7684\u6570\u5c0f\u4e86<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-43\"><a href=\"#cb6-43\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>         times<span class=\"op\">++;<\/span><\/span>\n<span id=\"cb6-44\"><a href=\"#cb6-44\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>         printf<span class=\"op\">(<\/span><span class=\"st\">\"\u8bf7\u518d\u6b21\u8f93\u5165\u8fd9\u4e2a\u6570\u5b57<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-45\"><a href=\"#cb6-45\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>         scanf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d<\/span><span class=\"st\">\"<\/span><span class=\"op\">,&amp;<\/span>enternumber<span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-46\"><a href=\"#cb6-46\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb6-47\"><a href=\"#cb6-47\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb6-48\"><a href=\"#cb6-48\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <\/span>\n<span id=\"cb6-49\"><a href=\"#cb6-49\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span> <span class=\"cf\">while<\/span> <span class=\"op\">(<\/span>enternumber<span class=\"op\">!=<\/span>numb<span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-50\"><a href=\"#cb6-50\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">1000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-51\"><a href=\"#cb6-51\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u606d\u559c\u4f60\u731c\u5bf9\u4e86\uff0c\u6570\u5b57\u662f<\/span><span class=\"sc\">%d<\/span><span class=\"st\">,\u4f60\u7528\u4e86<\/span><span class=\"sc\">%u<\/span><span class=\"st\">\u6b21<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span>numb<span class=\"op\">,<\/span>times<span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-52\"><a href=\"#cb6-52\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span> <span class=\"op\">(<\/span>yuqi<span class=\"op\">&lt;<\/span>times<span class=\"op\">)<\/span><\/span>\n<span id=\"cb6-53\"><a href=\"#cb6-53\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">{<\/span><\/span>\n<span id=\"cb6-54\"><a href=\"#cb6-54\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u4f46\u662f\u6bd4\u9884\u671f\u6162\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-55\"><a href=\"#cb6-55\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">};<\/span>   <\/span>\n<span id=\"cb6-56\"><a href=\"#cb6-56\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>yuqi<span class=\"op\">&gt;<\/span>times<span class=\"op\">){<\/span><\/span>\n<span id=\"cb6-57\"><a href=\"#cb6-57\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u6bd4\u9884\u60f3\u7684\u66f4\u597d\u5462\uff0c\u7ee7\u7eed\u52a0\u6cb9\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-58\"><a href=\"#cb6-58\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">};<\/span><\/span>\n<span id=\"cb6-59\"><a href=\"#cb6-59\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>yuqi<span class=\"op\">==<\/span>times<span class=\"op\">){<\/span><\/span>\n<span id=\"cb6-60\"><a href=\"#cb6-60\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u548c\u9884\u671f\u4e00\u6837\u7684\u5b8c\u7f8e\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-61\"><a href=\"#cb6-61\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">};<\/span><\/span>\n<span id=\"cb6-62\"><a href=\"#cb6-62\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"\u6e38\u620f\u5c06\u4f1a\u572810s\u540e\u81ea\u52a8\u5173\u95ed\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-63\"><a href=\"#cb6-63\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Sleep<span class=\"op\">(<\/span><span class=\"dv\">10000<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-64\"><a href=\"#cb6-64\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb6-65\"><a href=\"#cb6-65\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e73\u5747\u6570\u7b54\u6848<\/h3>\n\n\n\n<div class=\"sourceCode\" id=\"cb7\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb7-1\"><a href=\"#cb7-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb7-2\"><a href=\"#cb7-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb7-3\"><a href=\"#cb7-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb7-4\"><a href=\"#cb7-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <\/span>\n<span id=\"cb7-5\"><a href=\"#cb7-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> sum <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-6\"><a href=\"#cb7-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> count <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-7\"><a href=\"#cb7-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> num <span class=\"op\">=<\/span><span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-8\"><a href=\"#cb7-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <\/span>\n<span id=\"cb7-9\"><a href=\"#cb7-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">while<\/span> <span class=\"op\">(<\/span><span class=\"dv\">1<\/span><span class=\"op\">)<\/span><\/span>\n<span id=\"cb7-10\"><a href=\"#cb7-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">{<\/span>    <\/span>\n<span id=\"cb7-11\"><a href=\"#cb7-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        printf<span class=\"op\">(<\/span><span class=\"st\">\"Enter a number (enter -1 to stop):<\/span><span class=\"sc\">\\n<\/span><span class=\"st\"> \"<\/span><span class=\"op\">);<\/span>      <\/span>\n<span id=\"cb7-12\"><a href=\"#cb7-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        scanf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d<\/span><span class=\"st\">\"<\/span><span class=\"op\">,&amp;<\/span>num<span class=\"op\">);<\/span>       <\/span>\n<span id=\"cb7-13\"><a href=\"#cb7-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>num<span class=\"op\">==-<\/span><span class=\"dv\">1<\/span><span class=\"op\">)<\/span><\/span>\n<span id=\"cb7-14\"><a href=\"#cb7-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"op\">{<\/span><\/span>\n<span id=\"cb7-15\"><a href=\"#cb7-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>            <span class=\"cf\">break<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-16\"><a href=\"#cb7-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"op\">}<\/span><\/span>\n<span id=\"cb7-17\"><a href=\"#cb7-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        count<span class=\"op\">++;<\/span><\/span>\n<span id=\"cb7-18\"><a href=\"#cb7-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        sum<span class=\"op\">=<\/span>num<span class=\"op\">+<\/span>sum<span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-19\"><a href=\"#cb7-19\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb7-20\"><a href=\"#cb7-20\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span><span class=\"op\">(<\/span>count<span class=\"op\">&gt;<\/span><span class=\"dv\">0<\/span><span class=\"op\">){<\/span><\/span>\n<span id=\"cb7-21\"><a href=\"#cb7-21\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>             <span class=\"dt\">double<\/span> avg<span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-22\"><a href=\"#cb7-22\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>             avg <span class=\"op\">=<\/span> <span class=\"op\">(<\/span><span class=\"dt\">double<\/span><span class=\"op\">)<\/span>sum <span class=\"op\">\/<\/span> count<span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-23\"><a href=\"#cb7-23\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>             printf<span class=\"op\">(<\/span><span class=\"st\">\"average is <\/span><span class=\"sc\">%f<\/span><span class=\"st\">  <\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span>avg<span class=\"op\">);<\/span><\/span>\n<span id=\"cb7-24\"><a href=\"#cb7-24\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>             printf<span class=\"op\">(<\/span><span class=\"st\">\"your enter <\/span><span class=\"sc\">%d<\/span><span class=\"st\"> times<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span>count<span class=\"op\">);<\/span><\/span>\n<span id=\"cb7-25\"><a href=\"#cb7-25\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>            <span class=\"op\">}<\/span><span class=\"cf\">else<\/span><span class=\"op\">{<\/span><\/span>\n<span id=\"cb7-26\"><a href=\"#cb7-26\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>                printf<span class=\"op\">(<\/span><span class=\"st\">\"no enter the number\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb7-27\"><a href=\"#cb7-27\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>            <span class=\"op\">}<\/span><\/span>\n<span id=\"cb7-28\"><a href=\"#cb7-28\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb7-29\"><a href=\"#cb7-29\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6574\u6570\u9006\u5e8f\u7b54\u6848<\/h3>\n\n\n\n<div class=\"sourceCode\" id=\"cb8\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb8-1\"><a href=\"#cb8-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb8-2\"><a href=\"#cb8-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb8-3\"><a href=\"#cb8-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">(){<\/span><\/span>\n<span id=\"cb8-4\"><a href=\"#cb8-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> x<span class=\"op\">;<\/span><\/span>\n<span id=\"cb8-5\"><a href=\"#cb8-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> num<span class=\"op\">;<\/span><\/span>\n<span id=\"cb8-6\"><a href=\"#cb8-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> returnd <span class=\"op\">=<\/span><span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb8-7\"><a href=\"#cb8-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    scanf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d<\/span><span class=\"st\">\"<\/span><span class=\"op\">,&amp;<\/span>x<span class=\"op\">);<\/span><\/span>\n<span id=\"cb8-8\"><a href=\"#cb8-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <\/span>\n<span id=\"cb8-9\"><a href=\"#cb8-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">while<\/span><span class=\"op\">(<\/span>x<span class=\"op\">&gt;<\/span><span class=\"dv\">0<\/span><span class=\"op\">){<\/span><\/span>\n<span id=\"cb8-10\"><a href=\"#cb8-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        num <span class=\"op\">=<\/span>x<span class=\"op\">%<\/span><span class=\"dv\">10<\/span><span class=\"op\">;<\/span> <span class=\"co\">\/\/\u53d6\u4e2a\u4f4d<\/span><\/span>\n<span id=\"cb8-11\"><a href=\"#cb8-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"co\">\/\/printf(\"%d\",num); \/\/\u8f93\u51fa\u4e2a\u4f4d\u6570<\/span><\/span>\n<span id=\"cb8-12\"><a href=\"#cb8-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        returnd<span class=\"op\">=<\/span>returnd<span class=\"op\">*<\/span><span class=\"dv\">10<\/span><span class=\"op\">+<\/span>num<span class=\"op\">;<\/span><\/span>\n<span id=\"cb8-13\"><a href=\"#cb8-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        printf<span class=\"op\">(<\/span><span class=\"st\">\"x=<\/span><span class=\"sc\">%d\\n<\/span><span class=\"st\">num=<\/span><span class=\"sc\">%d\\n<\/span><span class=\"st\">returnd=<\/span><span class=\"sc\">%d\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span>x<span class=\"op\">,<\/span>num<span class=\"op\">,<\/span>returnd<span class=\"op\">);<\/span><\/span>\n<span id=\"cb8-14\"><a href=\"#cb8-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        x <span class=\"op\">\/=<\/span> <span class=\"dv\">10<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb8-15\"><a href=\"#cb8-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb8-16\"><a href=\"#cb8-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb8-17\"><a href=\"#cb8-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf <span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span>returnd<span class=\"op\">);<\/span><\/span>\n<span id=\"cb8-18\"><a href=\"#cb8-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5224\u65ad \u7528if\u505a\u5224\u65ad if\u8bed\u53e5 \u4f7f\u7528\u4f8b #include &lt;stdio.h&gt; int main(){ if(\u8868\u8fbe\u5f0f){  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":3,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":70,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/70"}],"wp:attachment":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}