{"id":337,"date":"2025-12-01T17:08:14","date_gmt":"2025-12-01T09:08:14","guid":{"rendered":"https:\/\/index.cmiteam.cn\/?p=337"},"modified":"2025-12-01T20:29:29","modified_gmt":"2025-12-01T12:29:29","slug":"c%e7%a8%8b%e5%ba%8f%e8%ae%be%e8%ae%a1-%e4%b8%8a%e6%9c%ba%e4%bd%9c%e4%b8%9a251201","status":"publish","type":"post","link":"https:\/\/index.cmiteam.cn\/index.php\/2025\/12\/01\/c%e7%a8%8b%e5%ba%8f%e8%ae%be%e8%ae%a1-%e4%b8%8a%e6%9c%ba%e4%bd%9c%e4%b8%9a251201\/","title":{"rendered":"C\u7a0b\u5e8f\u8bbe\u8ba1 \u4e0a\u673a\u4f5c\u4e1a251201"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u7b2c\u4e00\u9898<\/h1>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>2500\u5e74\u524d\u6570\u5b66\u5927\u5e08\u6bd5\u8fbe\u54e5\u62c9\u65af\u5c31\u53d1\u73b0\uff0c\u6b63\u6574\u6570\u6570\u5bf9220\u548c284\u4e4b\u95f4\u5b58\u5728\u7740\u5947\u5999\u7684\u8054\u7cfb\uff1a 220\u7684\u56e0\u6570\u4e4b\u548c\uff08\u9664\u4e86\u81ea\u8eab\u4e4b\u5916\u7684\u56e0\u6570\uff09\u4e3a1+2+4+5+10+11+20+22+44+55+110=284\uff0c\u800c284\u7684\u56e0\u6570\u4e4b\u548c\u5219\u4e3a1+2+4+71+142=220\u3002\u6bd5\u8fbe\u54e5\u62c9\u65af\u628a\u8fd9\u6837\u7684\u6570\u5bf9\u79f0\u4e3a\u76f8\u4eb2\u6570\uff08\u6ce8\u610f\uff1a\u6784\u6210\u76f8\u4eb2\u6570\u7684\u4e24\u4e2a\u6570\u4e0d\u7b49\u3002\u4e00\u4e2a\u4e3a\u96c4\u6570\uff0c\u53e6\u4e00\u4e2a\u79f0\u4e3a\u96cc\u6570\uff09\u3002\u7f16\u7a0b\u6c42M\u548cN\uff08M\u3001N\u4e3a\u5927\u4e8e1\u5e76\u4e14\u5728unsigned\u8868\u793a\u8303\u56f4\u5185\uff09\u4e4b\u95f4\u7684\u6240\u6709\u76f8\u4eb2\u6570\u3002M\u3001N\u7531\u7528\u6237\u4ece\u952e\u76d8\u4e0a\u8f93\u5165\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u7528\u6237\u8f93\u5165\u4e24\u4e2a\u6b63\u6574\u6570\u4fdd\u5b58\u5230M\u548cN\u4e2d\uff0c\u4ee5\u4e00\u4e2a\u7a7a\u683c\u5206\u9694\uff0c\u5982\uff1a<\/p>\n\n\n\n<p>100 300<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u7a0b\u5e8f\u627e\u51faM\u5230N\u95f4\u7684\u5404\u76f8\u4eb2\u6570\u5e76\u8f93\u51fa\u3002\u5404\u76f8\u4eb2\u6570\u7684\u8f93\u51fa\u683c\u5f0f\uff1a\u5148\u8f93\u51fa\u8be5\u76f8\u4eb2\u6570\u662fM\u5230N\u95f4\u7684\u7b2c\u51e0\u4e2a\u76f8\u4eb2\u6570\uff0c\u518d\u8f93\u51fa\u8be5\u76f8\u4eb2\u6570\u4e2d\u7684\u96cc\u3001\u96c4\u6570\u53ca\u5176\u56e0\u5b50\u8ba1\u7b97\u5f0f\u3002\u96cc\u96c4\u6570\u8f93\u51fa\u65f6\u5206\u522b\u5404\u5360\u4e00\u884c\uff0c\u8f93\u51fa\u65f6\u5148\u8f93\u51fa\u96cc\u96c4\u6570\u7684\u503c\uff0c\u518d\u8f93\u51fa\u82f1\u6587\u5192\u53f7\u201c:\u201d\uff0c\u518d\u4ece1\u5f00\u59cb\u8f93\u51fa\u5404\u56e0\u6570\u76f8\u52a0\u7684\u516c\u5f0f\uff0c\u6700\u540e\u8f93\u51fa\u82f1\u6587\u7b49\u53f7\u201c=\u201d\u548c\u6240\u6709\u56e0\u6570\u4e4b\u548c\u3002\u6ce8\u610f\uff1a\u6240\u6709\u8f93\u51fa\u56e0\u7d20\u95f4\u65e0\u7a7a\u683c\u3002\u5404\u76f8\u4eb2\u6570\u95f4\u7a7a\u4e00\u884c\u95f4\u9694\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u5165\u3011<\/p>\n\n\n\n<p>100 300<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u51fa\u3011<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>220:1+2+4+5+10+11+20+22+44+55+110=284<\/p>\n\n\n\n<p>284:1+2+4+71+142=220<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8bf4\u660e\u3011<\/p>\n\n\n\n<p>\u6837\u4f8b\u4e2d1\u8868\u793a100~300\u95f4\u7b2c1\u5bf9\u76f8\u4eb2\u6570\u3002220\u548c284\u662f\u6784\u6210\u8fd9\u5bf9\u76f8\u4eb2\u6570\u4e2d\u7684\u96cc\u96c4\u6570\uff0c\u6ce8\u610f\u5b83\u4eec\u7684\u8f93\u51fa\u683c\u5f0f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>using namespace std;<br>\u200b<br>int execute1(int a, int &amp;sum1) {<br> &nbsp; &nbsp;sum1 = 1;<br> &nbsp; &nbsp;for (int i = 2; i &lt; a; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (a % i == 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sum1 += i;<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br> &nbsp; &nbsp;return 0;<br>}<br>\u200b<br>int execute1_r(int a, int &amp;sum1) {<br> &nbsp; &nbsp;sum1 = 1;<br> &nbsp; &nbsp;cout &lt;&lt; a &lt;&lt; \":1\";<br> &nbsp; &nbsp;for (int i = 2; i &lt; a; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (a % i == 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; \"+\" &lt;&lt; i;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sum1 += i;<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br> &nbsp; &nbsp;cout &lt;&lt; \"=\" &lt;&lt; sum1 &lt;&lt; endl;<br> &nbsp; &nbsp;return 0;<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;int M, N;<br> &nbsp; &nbsp;cin &gt;&gt; M &gt;&gt; N;<br>\u200b<br> &nbsp; &nbsp;int count = 0;<br> &nbsp; &nbsp;for (int i = M; i &lt;= N; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;int sum1 = 0;<br> &nbsp; &nbsp; &nbsp; &nbsp;execute1(i, sum1);<br> &nbsp; &nbsp; &nbsp; &nbsp;if (sum1 &lt;= i || sum1 &gt; N) continue;<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp;int sum2 = 0;<br> &nbsp; &nbsp; &nbsp; &nbsp;execute1(sum1, sum2);<br> &nbsp; &nbsp; &nbsp; &nbsp;if (sum2 == i) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;count++;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (count &gt; 1) cout &lt;&lt; endl;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; count &lt;&lt; endl;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;execute1_r(i, sum1);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;execute1_r(sum1, sum2);<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>\u200b<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u4e8c\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>\u7f16\u5199\u51fd\u6570int prime_m( int n,int x[], long y[])\uff0c\u57282~n\u8303\u56f4\u5185\u67e5\u627e\u540c\u65f6\u7b26\u5408\u4ee5\u4e0b\u6761\u4ef6\u7684\u6574\u6570m\uff1a2m -1\u662f\u7d20\u6570\u30012m -1\u7684\u53cd\u5e8f\u6570\u662f\u5947\u6570\u30012m -1\u7684\u5341\u8fdb\u5236\u8868\u793a\u4e2d\u5305\u542b\u6570\u5b571\u3002\u5c062~n\u8303\u56f4\u5185\u7b26\u5408\u4e0a\u8ff0\u6761\u4ef6\u7684\u6240\u6709\u6574\u6570m\u4f9d\u6b21\u4fdd\u5b58\u5230x\u6307\u5411\u7684\u6570\u7ec4\u4e2d\uff0c\u5c06\u4e0em\u5bf9\u5e94\u7684\u6574\u65702m -1\u4f9d\u6b21\u4fdd\u5b58\u5230y\u6307\u5411\u7684\u6570\u7ec4\u4e2d\u3002\u51fd\u6570\u8fd4\u56dex\u6570\u7ec4\u4e2d\u4fdd\u5b58\u7684\u6574\u6570\u4e2a\u6570\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u6570\u636e:n=20<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u51fa\u7ed3\u679c:<\/p>\n\n\n\n<p>5 31<\/p>\n\n\n\n<p>7 127<\/p>\n\n\n\n<p>17 131071<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>#include &lt;cmath&gt;<br>using namespace std;<br>\u200b<br>bool isP(long n) {<br> &nbsp; &nbsp;if (n &lt;= 1) return false;<br> &nbsp; &nbsp;if (n == 2) return true;<br> &nbsp; &nbsp;if (n % 2 == 0) return false;<br> &nbsp; &nbsp;for (long i = 3; i &lt;= sqrt(n); i += 2)<br> &nbsp; &nbsp; &nbsp; &nbsp;if (n % i == 0) return false;<br> &nbsp; &nbsp;return true;<br>}<br>\u200b<br>long rev(long n) {<br> &nbsp; &nbsp;long r = 0;<br> &nbsp; &nbsp;while (n &gt; 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp;r = r * 10 + n % 10;<br> &nbsp; &nbsp; &nbsp; &nbsp;n \/= 10;<br> &nbsp;  }<br> &nbsp; &nbsp;return r;<br>}<br>\u200b<br>bool has1(long n) {<br> &nbsp; &nbsp;while (n &gt; 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (n % 10 == 1) return true;<br> &nbsp; &nbsp; &nbsp; &nbsp;n \/= 10;<br> &nbsp;  }<br> &nbsp; &nbsp;return false;<br>}<br>\u200b<br>int prime_m(int n, int x[], long y[]) {<br> &nbsp; &nbsp;int c = 0;<br> &nbsp; &nbsp;for (int m = 2; m &lt;= n; m++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;long num = static_cast&lt;long&gt;(pow(2, m)) - 1;<br> &nbsp; &nbsp; &nbsp; &nbsp;if (!isP(num)) continue;<br> &nbsp; &nbsp; &nbsp; &nbsp;if (rev(num) % 2 == 0) continue;<br> &nbsp; &nbsp; &nbsp; &nbsp;if (!has1(num)) continue;<br> &nbsp; &nbsp; &nbsp; &nbsp;x[c] = m;<br> &nbsp; &nbsp; &nbsp; &nbsp;y[c] = num;<br> &nbsp; &nbsp; &nbsp; &nbsp;c++;<br> &nbsp;  }<br> &nbsp; &nbsp;return c;<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;int x[100];<br> &nbsp; &nbsp;long y[100];<br> &nbsp; &nbsp;int n = 20;<br> &nbsp; &nbsp;int cnt = prime_m(n, x, y);<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;for (int i = 0; i &lt; cnt; i++)<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; x[i] &lt;&lt; \"\\t\" &lt;&lt; y[i] &lt;&lt; endl;<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u4e09\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>\u8f93\u5165\u4e00\u4e2a\u6b63\u6574\u6570n,\u751f\u6210\u4e00\u5f20\u9636\u4e58\u8868,\u8f93\u51fa1! ~n! \u7684\u503c\uff61\u8981\u6c42\u5b9a\u4e49\u548c\u8c03\u7528\u51fd\u6570fact(n)\u8ba1\u7b97n!,\u51fd\u6570\u7c7b\u578b\u4e3adouble\uff61<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u4ece\u952e\u76d8\u8f93\u5165\u4e00\u4e2a\u6b63\u6574\u6570n\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u8f93\u51fa\u6837\u4f8b1\u3011\uff08\u4e0b\u5212\u7ebf\u90e8\u5206\u8868\u793a\u8f93\u5165\uff09<\/p>\n\n\n\n<p>Enter n: 3<\/p>\n\n\n\n<p>1!=1<\/p>\n\n\n\n<p>2!=2<\/p>\n\n\n\n<p>3!=6<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8bf4\u660e\u3011<\/p>\n\n\n\n<p>\u8f93\u5165\u63d0\u793a\u7b26\u540e\u8981\u52a0\u4e00\u4e2a\u7a7a\u683c\u3002\u5176\u4e2d:\u540e\u8981\u52a0\u4e00\u4e2a\u4e14\u53ea\u80fd\u4e00\u4e2a\u7a7a\u683c\u3002<\/p>\n\n\n\n<p>\u8f93\u51fa\u8bed\u53e5\u7684=\u4e24\u8fb9\u65e0\u7a7a\u683c\u3002<\/p>\n\n\n\n<p>\u82f1\u6587\u5b57\u6bcd\u533a\u5206\u5927\u5c0f\u5199\u3002\u5fc5\u987b\u4e25\u683c\u6309\u6837\u4f8b\u8f93\u5165\u8f93\u51fa\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>using namespace std;<br>\u200b<br>double fact(int n) {<br> &nbsp; &nbsp;double result = 1;<br> &nbsp; &nbsp;for (int i = 1; i &lt;= n; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;result *= i;<br> &nbsp;  }<br> &nbsp; &nbsp;return result;<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;int n;<br> &nbsp; &nbsp;cout &lt;&lt; \"Enter n: \";<br> &nbsp; &nbsp;cin &gt;&gt; n;<br>\u200b<br> &nbsp; &nbsp;for (int i = 1; i &lt;= n; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; i &lt;&lt; \"!=\" &lt;&lt; fact(i) &lt;&lt; endl;<br> &nbsp;  }<br>\u200b<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u56db\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>\u9a8c\u8bc1\u54e5\u5fb7\u5df4\u8d6b\u731c\u60f3\uff1a\u4efb\u4f55\u4e00\u4e2a\u5927\u4e8e6\u7684\u5076\u6570\u5747\u53ef\u8868\u793a\u4e3a\u4e24\u4e2a\u7d20\u6570\u4e4b\u548c\uff61\u4f8b\u5982\uff0c6=3+3\uff0c8=3+5\uff0c......\uff0c18=5+13\uff61\u8981\u6c42\u5c066~100\u4e4b\u95f4\u7684\u5076\u6570\u90fd\u8868\u793a\u4e3a\u4e24\u4e2a\u7d20\u6570\u4e4b\u548c\uff0c\u8f93\u51fa\u65f6\u4e00\u884c\u8f93\u51fa\u4e94\u7ec4\uff61<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u65e0\u8f93\u5165<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u6309\u4ece\u5c0f\u5230\u5927\u3001\u6bcf\u7ec4\u4e94\u884c<\/p>\n\n\n\n<p>\u6bcf\u7ec4\u7684\u683c\u5f0f\u4e3a\uff1a\u56db\u4f4d=2\u4f4d+2\u4f4d\u3002<\/p>\n\n\n\n<p>\u7b49\u53f7\u548c\u52a0\u53f7\u4e24\u4fa7\u65e0\u7a7a\u683c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>#include &lt;iomanip&gt;<br>using namespace std;<br>\u200b<br>bool isPrime(int num) {<br> &nbsp; &nbsp;if (num &lt;= 1) return false;<br> &nbsp; &nbsp;if (num == 2) return true;<br> &nbsp; &nbsp;if (num % 2 == 0) return false;<br> &nbsp; &nbsp;for (int i = 3; i * i &lt;= num; i += 2) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (num % i == 0) return false;<br> &nbsp;  }<br> &nbsp; &nbsp;return true;<br>}<br>\u200b<br>void goldbach() {<br> &nbsp; &nbsp;int count = 0;<br> &nbsp; &nbsp;for (int even = 6; even &lt;= 100; even += 2) {<br> &nbsp; &nbsp; &nbsp; &nbsp;for (int p1 = 2; p1 &lt;= even \/ 2; p1++) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int p2 = even - p1;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (isPrime(p1) &amp;&amp; isPrime(p2)) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; setw(4) &lt;&lt; even &lt;&lt; \"=\" &lt;&lt; setw(2) &lt;&lt; p1 &lt;&lt; \"+\" &lt;&lt; setw(2) &lt;&lt; p2 &lt;&lt; \"  \";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;count++;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (count % 5 == 0) cout &lt;&lt; endl;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;goldbach();<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u4e94\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>\u8f93\u5165\u7cbe\u5ea6e \u548c\u5b9e\u6570x,\u7528\u4e0b\u5217\u516c\u5f0f\u6c42cos x \u7684\u8fd1\u4f3c\u503c,\u7cbe\u786e\u5230\u6700\u540e\u4e00\u9879\u7684\u7edd\u5bf9\u503c\u5c0f\u4e8ee\uff61\u8981\u6c42\u5b9a\u4e49\u548c\u8c03\u7528\u51fd\u6570funcos(e,x)\u6c42\u4f59\u5f26\u51fd\u6570\u7684\u8fd1\u4f3c\u503c\uff61<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/usual1009.oss-cn-shanghai.aliyuncs.com\/img\/202512011701083.png\" alt=\"image-20251201170104009\"\/><\/figure>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u5165\u4e24\u4e2a\u6d6e\u70b9\u6570\uff1a\u7cbe\u5ea6e\u548c\u5b9e\u6570x<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u8f93\u51fa\u6837\u4f8b1\u3011\uff08\u4e0b\u5212\u7ebf\u90e8\u5206\u8868\u793a\u8f93\u5165\uff09<\/p>\n\n\n\n<p>e: 0.001<\/p>\n\n\n\n<p>x: 1<\/p>\n\n\n\n<p>cos(x)=0.540<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8bf4\u660e\u3011<\/p>\n\n\n\n<p>\u8f93\u5165\u63d0\u793a\u7b26\u540e\u8981\u52a0\u4e00\u4e2a\u7a7a\u683c\u3002\u4f8b\u5982e: ;\uff0c\u5176\u4e2d:\u540e\u8981\u52a0\u4e00\u4e2a\u4e14\u53ea\u80fd\u4e00\u4e2a\u7a7a\u683c\u3002<\/p>\n\n\n\n<p>\u8f93\u51fa\u8bed\u53e5\u7684=\u4e24\u8fb9\u65e0\u7a7a\u683c<\/p>\n\n\n\n<p>\u8ba1\u7b97\u7ed3\u679c\u4fdd\u75593\u4f4d\u5c0f\u6570<\/p>\n\n\n\n<p>\u82f1\u6587\u5b57\u6bcd\u533a\u5206\u5927\u5c0f\u5199\u3002\u5fc5\u987b\u4e25\u683c\u6309\u6837\u4f8b\u8f93\u5165\u8f93\u51fa\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u516d\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>\u540c\u6784\u6570\u662f\u5176\u5e73\u65b9\u6570\u7684\u5c3e\u6570\u7b49\u4e8e\u8be5\u6570\u81ea\u8eab\u7684\u81ea\u7136\u6570\uff0c\u4f8b\u5982\uff1a25*25=625\u3002\u4ece\u952e\u76d8\u8f93\u5165\u4e00\u4e2a\u4e0d\u5927\u4e8e10000\u7684\u81ea\u7136\u6570\uff0c\u5224\u65ad\u5176\u662f\u5426\u662f\u540c\u6784\u6570\u5e76\u6309\u6837\u4f8b\u683c\u5f0f\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u4ece\u952e\u76d8\u8f93\u5165\u4e00\u4e2a\u4e0d\u5927\u4e8e10000\u7684\u81ea\u7136\u6570\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u51fa\u683c\u5f0f\u6309\u6837\u4f8b\u3002<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u51651\u3011<\/p>\n\n\n\n<p>25<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u51fa1\u3011<\/p>\n\n\n\n<p>25 yes,25*25=625<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u51652\u3011<\/p>\n\n\n\n<p>11<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u51fa2\u3011<\/p>\n\n\n\n<p>11 no,11*11=121<\/p>\n\n\n\n<p>\u3010\u8bc4\u5206\u6807\u51c6\u3011<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>using namespace std;<br>\u200b<br>bool isAutomorphic(int num) {<br> &nbsp; &nbsp;long square = num * num;<br> &nbsp; &nbsp;while (num &gt; 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (num % 10 != square % 10) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return false;<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp;num \/= 10;<br> &nbsp; &nbsp; &nbsp; &nbsp;square \/= 10;<br> &nbsp;  }<br> &nbsp; &nbsp;return true;<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;int num;<br> &nbsp; &nbsp;cin &gt;&gt; num;<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;if (isAutomorphic(num)) {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; num &lt;&lt; \" yes,\" &lt;&lt; num &lt;&lt; \"*\" &lt;&lt; num &lt;&lt; \"=\" &lt;&lt; num * num &lt;&lt; endl;<br> &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; num &lt;&lt; \" no,\" &lt;&lt; num &lt;&lt; \"*\" &lt;&lt; num &lt;&lt; \"=\" &lt;&lt; num * num &lt;&lt; endl;<br> &nbsp;  }<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u4e03\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011<\/p>\n\n\n\n<p>\u7edd\u5bf9\u7d20\u6570\u662f\u6307\u672c\u8eab\u662f\u7d20\u6570\uff0c\u5176\u9006\u5e8f\u6570\u4e5f\u662f\u7d20\u6570\u7684\u6570\u3002\u4f8b\u5982\uff1a10321\u4e0e12301\u662f\u7edd\u5bf9\u7d20\u6570\u3002<\/p>\n\n\n\n<p>\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u6c42\u51fa\u6240\u6709m~n\uff08m\u226511\uff0cn\u22641000000\uff09\u4e4b\u95f4\u7684\u7edd\u5bf9\u7d20\u6570<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u5f62\u5f0f\u3011\u4e24\u4e2a\u6574\u6570m\u548cn\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u5f62\u5f0f\u3011m~n\u4e4b\u95f4\u7684\u7edd\u5bf9\u7d20\u6570\uff0c\u6bcf\u4e2a\u6570\u4e4b\u95f4\u7528\u7a7a\u683c\u9694\u5f00\uff0c\u6bcf\u884c\u8f93\u51fa10\u4e2a<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u5165\u3011<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">11 300<\/pre>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u51fa\u3011<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">11 13 17 31 37 71 73 79 97 101<br>107 113 131 149 151 157 167 179 181 191<br>199<\/pre>\n\n\n\n<p>\u3010\u6837\u4f8b\u8bf4\u660e\u3011 \u3010\u8bc4\u5206\u6807\u51c6\u3011<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>#include &lt;cmath&gt;<br>using namespace std;<br>\u200b<br>bool isPrime(int num) {<br> &nbsp; &nbsp;if (num &lt;= 1) return false;<br> &nbsp; &nbsp;if (num == 2) return true;<br> &nbsp; &nbsp;if (num % 2 == 0) return false;<br> &nbsp; &nbsp;for (int i = 3; i * i &lt;= num; i += 2) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (num % i == 0) return false;<br> &nbsp;  }<br> &nbsp; &nbsp;return true;<br>}<br>\u200b<br>int reverseNumber(int num) {<br> &nbsp; &nbsp;int reversed = 0;<br> &nbsp; &nbsp;while (num &gt; 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp;reversed = reversed * 10 + num % 10;<br> &nbsp; &nbsp; &nbsp; &nbsp;num \/= 10;<br> &nbsp;  }<br> &nbsp; &nbsp;return reversed;<br>}<br>\u200b<br>void findAbsolutePrimes(int m, int n) {<br> &nbsp; &nbsp;int count = 0;<br> &nbsp; &nbsp;for (int num = m; num &lt;= n; num++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (isPrime(num)) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int reversed = reverseNumber(num);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (isPrime(reversed)) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; num;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;count++;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (count % 10 == 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; endl;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; \" \";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br> &nbsp; &nbsp;\/\/ \u786e\u4fdd\u6700\u540e\u6ca1\u6709\u591a\u4f59\u7684\u7a7a\u683c\u6216\u6362\u884c<br> &nbsp; &nbsp;if (count % 10 != 0) {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; endl;<br> &nbsp;  }<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;int m, n;<br> &nbsp; &nbsp;cin &gt;&gt; m &gt;&gt; n;<br> &nbsp; &nbsp;findAbsolutePrimes(m, n);<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u516b\u9898<\/h2>\n\n\n\n<p>\u3010\u95ee\u9898\u63cf\u8ff0\u3011\u51fd\u6570\u91cd\u8f7d\uff1a\u6570\u636e\u67e5\u627e<\/p>\n\n\n\n<p>\u7f16\u5199\u91cd\u8f7d\u51fd\u6570Finddata\uff0c\u67e5\u627e\u6574\u578b\u6570\u7ec4\u548c\u5b57\u7b26\u6570\u7ec4\u4e2d\u7684\u7279\u5b9a\u6570\u636e\uff0c\u627e\u5230\u51fd\u6570\u8fd4\u56de\u7b2c\u4e00\u4e2a\u6570\u636e\u7684\u4e0b\u6807\uff0c\u627e\u4e0d\u5230\u8fd4\u56de-1\u3002\u8bbemain\u51fd\u6570\u4e2d\u7684\u90e8\u5206\u4ee3\u7801\u5982\u4e0b\uff0c\u8bf7\u6839\u636e\u8f93\u5165\u3001\u8f93\u51fa\u683c\u5f0f\uff0c\u5b8c\u6210\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p>int main()<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>int fid, arr[] = {-11,3,5,13,27,8,23,45,2,3,-14,0,43,20,2,30,5,45,0,42,38,67 };<\/p>\n\n\n\n<p>char ch,str[] = \"The university seeks to integrate social service into its schooling.\";<\/p>\n\n\n\n<p>int N = sizeof(arr) \/ sizeof(int);<\/p>\n\n\n\n<p>cin&gt;&gt;fid;\/\/fid\u4e3a\u8981\u67e5\u627e\u7684\u6574\u6570<\/p>\n\n\n\n<p>int i = Finddata(arr, N, fid);<\/p>\n\n\n\n<p>\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\/\/\u7701\u7565\u82e5\u5e72\u6761\u8bed\u53e5<\/p>\n\n\n\n<p>cin&gt;&gt;ch; \/\/ch\u4e3a\u8981\u67e5\u627e\u7684\u5b57\u7b26<\/p>\n\n\n\n<p>i = Finddata(str, ch);<\/p>\n\n\n\n<p>\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\/\/\u7701\u7565\u82e5\u5e72\u6761\u8bed\u53e5<\/p>\n\n\n\n<p>return 0;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u8f93\u51fa\u5f62\u5f0f\u3011<\/p>\n\n\n\n<p>27 \uff08\u7528\u6237\u8f93\u5165\u8981\u67e5\u627e\u7684\u6574\u657027\uff09<\/p>\n\n\n\n<p>Found:4 \uff08\u7a0b\u5e8f\u8f93\u51fa\u67e5\u627e\u5230\u7684\u6574\u657027\u7684\u4e0b\u68074\uff09<\/p>\n\n\n\n<p>u \uff08\u7528\u6237\u8f93\u5165\u8981\u67e5\u627e\u7684\u5b57\u7b26u\uff09<\/p>\n\n\n\n<p>Found:4 \uff08\u7a0b\u5e8f\u8f93\u51fa\u67e5\u627e\u5230\u7684\u5b57\u7b26u\u7684\u4e0b\u68074\uff09<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8f93\u5165\u8f93\u51fa\u3011<\/p>\n\n\n\n<p>20<\/p>\n\n\n\n<p>Found:13<\/p>\n\n\n\n<p>X<\/p>\n\n\n\n<p>Not Found!<\/p>\n\n\n\n<p>\u3010\u6837\u4f8b\u8bf4\u660e\u3011<\/p>\n\n\n\n<p>arr\u53castr\u6570\u7ec4\u4e3a\u7cfb\u7edf\u6837\u4f8b\u6d4b\u8bd5\u6570\u636e\uff0c\u4e0d\u5f97\u4fee\u6539\u3002<\/p>\n\n\n\n<p>\u3010\u8bc4\u5206\u6807\u51c6\u3011<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;<br>using namespace std;<br>\u200b<br>int Finddata(int arr[], int size, int target) {<br> &nbsp; &nbsp;for (int i = 0; i &lt; size; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (arr[i] == target) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return i;<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br> &nbsp; &nbsp;return -1;<br>}<br>\u200b<br>int Finddata(char str[], char target) {<br> &nbsp; &nbsp;for (int i = 0; str[i] != '\\0'; i++) {<br> &nbsp; &nbsp; &nbsp; &nbsp;if (str[i] == target) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return i;<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br> &nbsp; &nbsp;return -1;<br>}<br>\u200b<br>int main() {<br> &nbsp; &nbsp;int fid, arr[] = {-11,3,5,13,27,8,23,45,2,3,-14,0,43,20,2,30,5,45,0,42,38,67};<br> &nbsp; &nbsp;char ch, str[] = \"The university seeks to integrate social service into its schooling.\";<br> &nbsp; &nbsp;int N = sizeof(arr) \/ sizeof(int);<br>\u200b<br> &nbsp; &nbsp;cin &gt;&gt; fid;<br> &nbsp; &nbsp;int i = Finddata(arr, N, fid);<br> &nbsp; &nbsp;if (i != -1) {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; \"Found:\" &lt;&lt; i &lt;&lt; endl;<br> &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; \"Not Found!\" &lt;&lt; endl;<br> &nbsp;  }<br>\u200b<br> &nbsp; &nbsp;cin &gt;&gt; ch;<br> &nbsp; &nbsp;i = Finddata(str, ch);<br> &nbsp; &nbsp;if (i != -1) {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; \"Found:\" &lt;&lt; i &lt;&lt; endl;<br> &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; \"Not Found!\" &lt;&lt; endl;<br> &nbsp;  }<br>\u200b<br> &nbsp; &nbsp;return 0;<br>}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u9898 \u3010\u95ee\u9898\u63cf\u8ff0\u3011 2500\u5e74\u524d\u6570\u5b66\u5927\u5e08\u6bd5\u8fbe\u54e5\u62c9\u65af\u5c31\u53d1\u73b0\uff0c\u6b63\u6574\u6570\u6570\u5bf9220\u548c284\u4e4b\u95f4\u5b58\u5728\u7740\u5947\u5999\u7684\u8054\u7cfb\uff1a 220\u7684\u56e0\u6570\u4e4b\u548c\uff08\u9664\u4e86 ...<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":""},"categories":[25],"tags":[],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-technics"],"_links":{"self":[{"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":0,"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"wp:attachment":[{"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/index.cmiteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}