{"id":172,"date":"2021-10-12T21:43:36","date_gmt":"2021-10-12T13:43:36","guid":{"rendered":"https:\/\/mzdyl.xyz\/?p=172"},"modified":"2022-03-19T00:26:32","modified_gmt":"2022-03-18T16:26:32","slug":"%e4%bd%9c%e4%b8%9a6-1-%e5%ae%8c%e6%95%b0%ef%bc%9f%e6%b0%b4%e4%bb%99%e8%8a%b1%e6%95%b0%ef%bc%9f%e7%b4%a0%e6%95%b0%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/mzdyl.xyz\/index.php\/2021\/10\/12\/%e4%bd%9c%e4%b8%9a6-1-%e5%ae%8c%e6%95%b0%ef%bc%9f%e6%b0%b4%e4%bb%99%e8%8a%b1%e6%95%b0%ef%bc%9f%e7%b4%a0%e6%95%b0%ef%bc%9f\/","title":{"rendered":"\u4f5c\u4e1a6-1 \u5b8c\u6570\uff1f\u6c34\u4ed9\u82b1\u6570\uff1f\u7d20\u6570\uff1f"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include \"bits\/stdc++.h\"\nusing namespace std;\n\nint judge_profect_num(int a)\n{\n    int s = 0;\n    int i = 1;\n    while(i&lt;(a\/2+1))\n    {\n        if(a%i==0)\n        {\n            s+=i;\n        }\n\t\ti++;\n    }\n    if(s==a) cout &lt;&lt; \"\u662f\u7684\uff0c\u662f\u5b8c\u6570\uff01\";\n    else cout &lt;&lt; \"Sorry,\u4e0d\u662f\u5b8c\u6570\uff01\";\n    return 0;\n}\nint judge_flower_num(int b)\n{\n    int x,y,z;\n    x = b%10;\/\/\u4e2a\u4f4d\n    y = b\/10%10;\/\/\u5341\u4f4d\n    z = b\/100%10;\/\/\u767e\u4f4d\n    int num = pow(x,3) + pow (y,3) + pow(z,3);\n    if(num == b) cout &lt;&lt; \"\u662f\u7684\uff0c\u662f\u6c34\u4ed9\u82b1\u6570\uff01\";\n    else cout &lt;&lt; \"Sorry,\u4e0d\u662f\u6c34\u4ed9\u82b1\u6570\uff01\";\n    return 0;\n}\n\nint judge_prime(int c)\n{\n        for(int i = 2; i*i &lt;= c; i++)\n        {\n            if(c % i == 0)\n            {\n                cout &lt;&lt; \"Sorry,\u4e0d\u662f\u8d28\u6570,\u662f\u7d20\u6570\uff01\";\n                return 0;\n            }\n        }\n        cout &lt;&lt; \"\u4e0d\u662f\u7d20\u6570\uff0c\u662f\u8d28\u6570\uff01\";\n        return 0;\n}\n\nint main()\n{\n    cout &lt;&lt; \"\u8bf7\u4ee5\u6b64\u8f93\u5165\u8981\u5224\u65ad\u7684\u5b8c\u6570\uff0c\u6c34\u4ed9\u82b1\u6570(\u4e09\u4f4d\u6570)\uff0c\u7d20\u6570\u3002\"&lt;&lt;endl;\n    cout &lt;&lt; \"\u8bf7\u7528\u7a7a\u683c\u9694\u5f00\u4e09\u4e2a\u6570\"&lt;&lt; endl &lt;&lt;endl;\n    int a,b,c;\n    cin &gt;&gt; a &gt;&gt; b &gt;&gt; c;\n    judge_profect_num(a);\n    cout &lt;&lt; endl;\n    judge_flower_num(b);\n    cout &lt;&lt; endl;\n    judge_prime(c);\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":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-c_plus"],"_links":{"self":[{"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=172"}],"version-history":[{"count":4,"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/posts\/172\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mzdyl.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}