{"id":80,"date":"2025-10-30T10:56:42","date_gmt":"2025-10-30T02:56:42","guid":{"rendered":"https:\/\/cilici.cn\/?p=80"},"modified":"2025-10-30T11:06:44","modified_gmt":"2025-10-30T03:06:44","slug":"%e8%87%aa%e7%94%a8%e4%bb%a3%e7%a0%81%e5%ad%98%e5%82%a8","status":"publish","type":"post","link":"https:\/\/cilici.cn\/index.php\/2025\/10\/30\/%e8%87%aa%e7%94%a8%e4%bb%a3%e7%a0%81%e5%ad%98%e5%82%a8\/","title":{"rendered":"\u81ea\u7528\u4ee3\u7801\u5b58\u50a8"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h>\n\nvoid main() {\n    char g;\n    float s;\n\n    printf(\"\u8bf7\u8f93\u5165\u5b66\u751f\u6210\u7ee9:\\n\");\n    scanf(\"%f\", &amp;s);\n\n    while (s > 100 || s &lt; 0) {\n        printf(\"\u8f93\u5165\u6709\u8bef, \u8bf7\u91cd\u65b0\u8f93\u5165!\\n\");\n        scanf(\"%f\", &amp;s);\n    }\n\n    switch ((int)(s \/ 10)) {\n        case 10:\n        case 9:\n            g = 'A';\n            break;\n        case 8:\n            g = 'B';\n            break;\n        case 7:\n            g = 'C';\n            break;\n        case 6:\n            g = 'D';\n            break;\n        case 5:\n        case 4:\n        case 3:\n        case 2:\n        case 1:\n        case 0:\n            g = 'E';\n            break;\n    }\n\n    printf(\"\u6210\u7ee9\u4e3a%5.1f\u5206, \u6210\u7ee9\u7b49\u7ea7\u4e3a%c\u3002\\n\", s, g);\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h>\n#include &lt;math.h>\n\nint main() {\n    int num;\n    printf(\"\u8bf7\u8f93\u5165\u4e00\u4e2a\u4e0d\u591a\u4e8e5\u4f4d\u7684\u6b63\u6574\u6570: \");\n    scanf(\"%d\", &amp;num);\n\n    \/\/ \u68c0\u67e5\u8f93\u5165\u662f\u5426\u5408\u6cd5\n    if (num &lt;= 0) {\n        printf(\"\u8f93\u5165\u9519\u8bef\uff0c\u5e94\u4e3a\u6b63\u6574\u6570\\n\");\n        return 1;\n    }\n\n    \/\/ \u68c0\u67e5\u6570\u5b57\u662f\u5426\u8d85\u8fc75\u4f4d\n    if (num > 99999) {\n        printf(\"\u8f93\u5165\u9519\u8bef\uff0c\u6570\u5b57\u4e0d\u80fd\u8d85\u8fc75\u4f4d\\n\");\n        return 1;\n    }\n\n    \/\/ \u8ba1\u7b97\u4f4d\u6570\n    int temp = num;\n    int digit_count = 0;\n    while (temp != 0) {\n        temp \/= 10;\n        digit_count++;\n    }\n    printf(\"\u8fd9\u4e2a\u6570\u662f%d\u4f4d\u6570\\n\", digit_count);\n\n    \/\/ \u5206\u522b\u8f93\u51fa\u6bcf\u4e00\u4f4d\u6570\u5b57\n    printf(\"\u6bcf\u4e00\u4f4d\u6570\u5b57\u5206\u522b\u662f: \");\n    temp = num;\n    int digits&#91;5]; \/\/ \u5b58\u50a8\u6bcf\u4e00\u4f4d\u6570\u5b57\n    for (int i = digit_count - 1; i >= 0; i--) {\n        digits&#91;i] = temp % 10;\n        temp \/= 10;\n    }\n    for (int i = 0; i &lt; digit_count; i++) {\n        printf(\"%d \", digits&#91;i]);\n    }\n    printf(\"\\n\");\n\n    \/\/ \u9006\u5e8f\u8f93\u51fa\u5404\u4f4d\u6570\u5b57\n    printf(\"\u9006\u5e8f\u8f93\u51fa\u5404\u4f4d\u6570\u5b57: \");\n    temp = num;\n    while (temp != 0) {\n        printf(\"%d\", temp % 10);\n        temp \/= 10;\n    }\n    printf(\"\\n\");\n\n    return 0;\n}\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h>\n#include &lt;math.h>\n\nint main() {\n    int num;\n    scanf(\"%d\", &amp;num);\n    if (num &lt;= 0) {\n        printf(\"\u8f93\u5165\u9519\u8bef\uff0c\u5e94\u4e3a\u6b63\u6574\u6570\\n\");\n        return 1;\n    }\n    if (num > 99999) {\n        printf(\"\u8f93\u5165\u9519\u8bef\uff0c\u6570\u5b57\u4e0d\u80fd\u8d85\u8fc75\u4f4d\\n\");\n        return 1;\n    }\n    int digit_count = 0, n = num;\n    while (n != 0) {\n        n \/= 10;\n        digit_count++;\n    }\n    printf(\"\u8fd9\u4e2a\u6570\u662f%d\u4f4d\u6570\\n\", digit_count);\n    printf(\"\u6bcf\u4e00\u4f4d\u6570\u5b57\u5206\u522b\u662f: \");\n    n = num;\n    for (int i = digit_count - 1; i >= 0; i--) {\n        printf(\"%d \", (n \/ (int)pow(10, i)) % 10);\n    }\n    printf(\"\\n\u9006\u5e8f\u8f93\u51fa\u5404\u4f4d\u6570\u5b57: \");\n    n = num;\n    while (n != 0) {\n        printf(\"%d\", n % 10);\n        n \/= 10;\n    }\n    printf(\"\\n\");\n    return 0;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":3,"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":84,"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/posts\/80\/revisions\/84"}],"wp:attachment":[{"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cilici.cn\/index.php\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}