{"id":142,"date":"2021-06-28T11:25:53","date_gmt":"2021-06-28T03:25:53","guid":{"rendered":"https:\/\/wangsilin.cn\/?p=142"},"modified":"2021-06-28T11:25:53","modified_gmt":"2021-06-28T03:25:53","slug":"%e5%b0%8f%e5%b0%8f%e8%ae%a1%e7%ae%97%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wangsilin.cn\/index.php\/2021\/06\/28\/142\/","title":{"rendered":"\u5c0f\u5c0f\u8ba1\u7b97\u5668"},"content":{"rendered":"\n<div class=\"wp-block-origami-prism\"><pre class=\"line-numbers match-braces rainbow-braces language-cpp\"><code class=\"language-cpp\">\/\/\u554a\u554a\u554a\uff0c\u522b\u7ed9\u6211\u62a5\u9519\u4e86\u554a\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\n#include&lt;iostream>\n#include&lt;cmath>\n#include&lt;iomanip>\n#include&lt;cstring>\n#include&lt;stdio.h>\n\nusing namespace std;\n\n\/\/\u52a0\u6cd5\nvoid jiafa() {\n\tint x, y;\n\tint result = 0;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e24\u4e2a\u6574\u6570\uff1a\" &lt;&lt; endl;\n\tcin >> x >> y;\n\tresult = x + y;\n\tcout &lt;&lt; \"\u52a0\u6cd5\u7ed3\u679c\u7684\u5341\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; result &lt;&lt; endl;\n\tcout &lt;&lt; \"\u52a0\u6cd5\u7ed3\u679c\u7684\u516b\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; oct &lt;&lt; result &lt;&lt; endl;\n\tcout &lt;&lt; \"\u52a0\u6cd5\u7ed3\u679c\u7684\u5341\u516d\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; hex &lt;&lt; result &lt;&lt; endl;\n}\n\n\/\/\u51cf\u6cd5\nvoid jianfa() {\n\tint x, y;\n\tint result = 0;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e24\u4e2a\u6574\u6570x\u548cy\uff0c\u8ba1\u7b97x-y\u7684\u503c\uff1a\" &lt;&lt; endl;\n\tcin >> x >> y;\n\tresult = x - y;\n\tcout &lt;&lt; \"\u51cf\u6cd5\u7ed3\u679c\u5341\u8fdb\u5236\u4e3a\uff1a\" &lt;&lt; result &lt;&lt; endl;\n\tcout &lt;&lt; \"\u51cf\u6cd5\u7ed3\u679c\u7684\u516b\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; oct &lt;&lt; result &lt;&lt; endl;\n\tcout &lt;&lt; \"\u51cf\u6cd5\u7ed3\u679c\u7684\u5341\u516d\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; hex &lt;&lt; result &lt;&lt; endl;\n}\n\n\/\/\u4e58\u6cd5\nvoid chengfa() {\n\tdouble x, y;\n\tdouble result;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e24\u4e2a\u6570\uff1a\" &lt;&lt; endl;\n\tcin >> x >> y;\n\tresult = x * y;\n\tprintf(\"\u4e58\u6cd5\u7ed3\u679c\u7684\u5c0f\u6570\u5f62\u5f0f\u662f%.6f\\n\", result);\n\tprintf(\"\u4e58\u6cd5\u7ed3\u679c\u7684\u6307\u6570\u5f62\u5f0f\u662f%e\\n\", result);\n}\n\n\/\/\u9664\u6cd5 \nvoid chufa() {\n\tfloat x, y;\n\tdouble result;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u88ab\u9664\u6570x\uff1a\" &lt;&lt; endl;\n\tcin >> x;\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u975e0\u9664\u6570y\uff1a\";\n\tcin >> y;\n\twhile (y == 0) {\n\t\tcout &lt;&lt; \"\u9664\u6570\u4e0d\u80fd\u4e3a0\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u9664\u6570y\uff1a\" &lt;&lt; endl;\n\t\tcin >> y;\n\t}\n\tresult = x \/ y;\n\tprintf(\"\u9664\u6cd5\u7ed3\u679c\u7684\u5c0f\u6570\u5f62\u5f0f\u662f%.6f\\n\", result);\n\tprintf(\"\u9664\u6cd5\u7ed3\u679c\u7684\u6307\u6570\u5f62\u5f0f\u662f%e\\n\", result);\n}\n\n\/\/\u53d6\u6a21 \nvoid qumo() {\n\tint x, y;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570\u548c\u8981\u6a21\u7684\u503c\uff1a\" &lt;&lt; endl;\n\tint result;\n\tcin >> x >> y;\n\tresult = x % y;\n\tcout &lt;&lt; \"\u53d6\u6a21\u7ed3\u679c\u5341\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; result &lt;&lt; endl;\n\tcout &lt;&lt; \"\u53d6\u6a21\u7ed3\u679c\u7684\u516b\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; oct &lt;&lt; result &lt;&lt; endl;\n\tcout &lt;&lt; \"\u53d6\u6a21\u7ed3\u679c\u7684\u5341\u516d\u8fdb\u5236\u5f62\u5f0f\u4e3a\uff1a\" &lt;&lt; hex &lt;&lt; result &lt;&lt; endl;\n}\n\n\/\/\u8ba1\u7b97\u5706\u9762\u79ef \nvoid yuanmianji() {\n\tdouble r, pi = 3.14;\n\tdouble result;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u5706\u7684\u534a\u5f84\uff1a\";\n\tcin >> r;\n\tresult = pi * r * r;\n\tcout &lt;&lt; \"\u6b64\u5706\u7684\u9762\u79ef\u4e3a\uff1a\" &lt;&lt; result&lt;&lt;endl;\n\tcout &lt;&lt; \"\u6b64\u5706\u7684\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\u7684\u9762\u79ef\u4e3a\uff1a\" &lt;&lt; fixed &lt;&lt; setprecision(2) &lt;&lt; result &lt;&lt; endl;\n}\n\n\/\/\u5224\u65ad\u6570\u5b57\u7684\u4f4d\u6570\nvoid weishu() {\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u4e09\u4f4d\u6570\u4ee5\u5185\u7684\u6b63\u6574\u6570\uff1a\";\n\tint a;\n\tcin >> a;\n\twhile (a &lt; 0 || a >= 1000) {\n\t\tcout &lt;&lt; \"\u8f93\u5165\u7684\u6570\u4e0d\u662f\u4e09\u4f4d\u4ee5\u5185\u7684\u6b63\u6574\u6570\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff1a\" &lt;&lt; endl;\n\t\tcin >> a;\n\t}\n\tint ge, shi, bai;\n\tge = a % 10;\n\tshi = (a % 100) \/ 10;\n\tbai = a \/ 100;\n\tcout &lt;&lt; \"\u767e\u4f4d\u662f\uff1a\" &lt;&lt; bai &lt;&lt; \",\u5341\u4f4d\u662f\uff1a\" &lt;&lt; shi &lt;&lt; \",\u4e2a\u4f4d\u662f\uff1a\" &lt;&lt; ge &lt;&lt; endl;\n}\n\n\/\/\u5224\u65ad\u95f0\u5e74\nvoid runnian() {\n\tint year;\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u9700\u8981\u5224\u65ad\u7684\u5e74\u4efd\uff1a\";\n\tcin >> year;\n\tif ((year % 4 == 0 &amp;&amp; year % 100 != 0) || year % 400 == 0) {\n\t\tcout &lt;&lt; year &lt;&lt; \"\u5e74\u662f\u95f0\u5e74\" &lt;&lt; endl; \n\t}\n\telse { cout &lt;&lt; year &lt;&lt; \"\u5e74\u662f\u5e73\u5e74\" &lt;&lt; endl; }\n}\n\n\/\/\u6210\u7ee9\u8f6c\u6362\nvoid chengji() {\n\tint grade;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u767e\u5206\u5236\u7684\u6210\u7ee9\uff1a\";\n\tcin >> grade;\n\twhile (grade &lt; 0 || grade>100) {\n\t\tcout &lt;&lt; \"\u60a8\u8f93\u5165\u7684\u6210\u7ee9\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff1a\";\n\t\tcin >> grade;\n\t}\n\tif (grade >= 0 &amp;&amp; grade &lt;= 59) {\n\t\tcout &lt;&lt; \"\u4e0d\u53ca\u683c\" &lt;&lt; endl;\n\t}\n\telse if (grade &lt;= 69) {\n\t\tcout &lt;&lt; \"\u53ca\u683c\" &lt;&lt; endl;\n\t}\n\telse if (grade &lt;= 79) {\n\t\tcout &lt;&lt; \"\u4e2d\" &lt;&lt; endl;\n\t}\n\telse if (grade &lt;= 89) {\n\t\tcout &lt;&lt; \"\u826f\" &lt;&lt; endl;\n\t}\n\telse if (grade &lt;= 100) {\n\t\tcout &lt;&lt; \"\u4f18\u79c0\" &lt;&lt; endl;\n\t}\n}\n\n\/\/\u8ba1\u7b97\u4ece1\u5230\u8f93\u5165\u6570\u4e4b\u95f4\u7684\u5947\u6570\u548c \uff08for\uff09\nvoid jishuhe() {\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u4e00\u4e2a\u6b63\u6574\u6570\uff1a\";\n\tint a, result = 0, i;\n\tcin >> a;\n\twhile (a &lt; 1) {\n\t\tcout &lt;&lt; \"\u60a8\u8f93\u5165\u7684\u6570\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff1a\";\n\t\tcin >> a;\n\t}\n\tfor (i = 0; i &lt;= a; i++) {\n\t\tif ((i &amp; 2) != 0) {\n\t\t\tresult += i;\n\t\t}\n\t}\n\tcout &lt;&lt; \"\u4ece1\u5230\" &lt;&lt; a &lt;&lt; \"\u4e4b\u95f4\u7684\u5947\u6570\u548c\u4e3a\uff1a\" &lt;&lt; result &lt;&lt; endl;\n}\n\n\/\/\u8ba1\u7b97\u4ece1\u5230\u8f93\u5165\u6570\u4e4b\u95f4\u7684\u5076\u6570\u548c \uff08while\uff09\nvoid oushuhe() {\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u4e00\u4e2a\u6b63\u6574\u6570\uff1a\";\n\tint a, result = 0, i;\n\tcin >> a;\n\twhile (a &lt; 1) {\n\t\tcout &lt;&lt; \"\u60a8\u8f93\u5165\u7684\u6570\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff1a\";\n\t\tcin >> a;\n\t}\n\ti = 0;\n\twhile (i &lt;= a) {\n\t\tif (i % 2 == 0) {\n\t\t\tresult += i;\n\t\t}\n\t\ti++;\n\t}\n\tcout &lt;&lt; \"\u4ece1\u5230\" &lt;&lt; a &lt;&lt; \"\u4e4b\u95f4\u7684\u5076\u6570\u548c\u4e3a\uff1a\" &lt;&lt; result &lt;&lt; endl;\n}\n\n\/\/\u8f93\u51fa\u4ece1\u5230\u8f93\u5165\u6570\u4e4b\u95f4\u6240\u67093\u7684\u500d\u6570 \uff08do-while\uff09\nvoid sanbeishu() {\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u4e00\u4e2a\u6b63\u6574\u6570\uff1a\";\n\tint a, result = 0, i = 0;\n\tcin >> a;\n\tcout &lt;&lt; \"\u75311\u5230\" &lt;&lt; a &lt;&lt; \"\u4e4b\u95f43\u7684\u500d\u6570\u4e3a\uff1a\";\n\tdo {\n\t\ti++;\n\t\tif (i % 3 == 0) {\n\t\t\tresult = i;\n\t\t\tcout &lt;&lt; result &lt;&lt; \",\";\n\t\t}\n\t} while (i &lt;= a);\n}\n\n\/\/\u6c42\u5373\u88ab3\u6574\u9664\u53c8\u88ab5\u6574\u9664\u7684\u6570\nvoid zhengchushu() {\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u4e24\u4e2a\u6570\uff1a\" &lt;&lt; endl;\n\tfloat a, b;\n\tint i, A, B;\n\tcin >> a >> b;\n\tif (a > b) {\n\t\tA = (int)b;\n\t\tB = (int)a;\n\t}\n\telse {\n\t\tA = a;\n\t\tB = b;\n\t}\n\tfor (i = A; i &lt;= B; i++) {\n\t\tif (i % 3 == 0 &amp;&amp; i % 5 == 0) {\n\t\t\tcout &lt;&lt; \"\u4ece\" &lt;&lt; A &lt;&lt; \"\u5230\" &lt;&lt; B &lt;&lt; \"\u95f4\u7b2c\u4e00\u4e2a\u65e2\u80fd\u88ab3\u6574\u9664\u53c8\u80fd\u88ab5\u6574\u9664\u7684\u6570\u4e3a:  \" &lt;&lt; i &lt;&lt; endl;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n\/\/\u6c42\u6c34\u4ed9\u82b1\u6570\nvoid shuixianjhua() {\n\tint i, ge, shi, bai;\n\tcout &lt;&lt; \"\u6c34\u4ed9\u82b1\u6570\u4e3a\uff1a\";\n\tfor (i = 100; i &lt; 1000; i++) { \n\t\tge = i % 10;\n\t\tshi = (i % 100) \/ 10;\n\t\tbai = i \/ 100;\n\t\tif (i == ge * ge * ge + shi * shi * shi + bai * bai * bai) {\n\t\t\tcout &lt;&lt; i &lt;&lt; \" , \";\n\t\t}\n\t}\n}\n\n\/\/\u6c42\u6700\u5927\u503c \nint zuidazhi() \n\t{\n\t\tint x, y;\n\t\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e24\u4e2a\u6574\u6570\uff0c\u5e76\u4ee5\u7a7a\u683c\u9694\u5f00\uff1a\" &lt;&lt; endl;\n\t\tcin >> x >> y;\n\tint result;\n\tresult = max(x, y);\n\tcout &lt;&lt; \"\u6700\u5927\u503c\u4e3a\uff1a\" &lt;&lt; result &lt;&lt; endl;\n\treturn 0;\n}\n\n\/\/\u6c42\u6700\u5927\u6700\u5c0f\u503c\nint maxandmin() {\n\tint x,y,m,n;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u4e24\u4e2a\u6574\u6570\uff1a\" &lt;&lt; endl;\n\tcin >> x >> y;\n\tm = max(x, y);\n\tn = min(x, y);\n\tcout &lt;&lt; \"\u6700\u5927\u503c\u4e3a\uff1a\" &lt;&lt; m &lt;&lt; \"\uff0c\u6700\u5c0f\u503c\u4e3a\uff1a\" &lt;&lt; n &lt;&lt; endl;\n\treturn 0;\n}\n\n\/\/\u5192\u6ce1\u6392\u5e8f\nvoid maopao() {\n\tint a[10], i, j;\n\tint temp;\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\u5341\u4e2a\u6570\uff1a\" &lt;&lt; endl;\n\tfor (i = 0; i &lt; 10; i++) {\n\t\tcin >> a[i];\n\t}\n\tfor (i = 0; i &lt; 10 - 1; i++) {\n\t\tfor (j = 0; j &lt; 10 - i - 1; j++) {\n\t\t\tif (a[j] > a[j + 1]) {\n\t\t\t\ttemp = a[j];\n\t\t\t\ta[j] = a[j + 1];\n\t\t\t\ta[j + 1] = temp;\n\t\t\t}\n\t\t}\n\t}\n\tfor (i = 0; i &lt; 10; i++) {\n\t\tcout &lt;&lt; a[i] &lt;&lt; \" \uff0c \";\n\t}\n}\n\n\/\/\u77e9\u9635\u8f6c\u7f6e\nvoid juzenzhuanzhi() {\n\tint a[200][200], i, j;\n\tint x, y;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u60a8\u8981\u5b9a\u4e49\u6570\u7ec4\u7684\u884c\u6570x=\";\n\tcin >> x;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u60a8\u8981\u5b9a\u4e49\u6570\u7ec4\u7684\u5217\u6570y=\";\n\tcin >> y;\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\" &lt;&lt; x * y &lt;&lt; \"\u4e2a\u6570\u5b57\uff1a\" &lt;&lt; endl;\n\tfor (i = 0; i &lt; x; i++) {\n\t\tfor (j = 0; j &lt; y; j++) {\n\t\t\tcin >> a[i][j];\n\t\t}\n\t}\n\tcout &lt;&lt; \"\u60a8\u8f93\u5165\u7684\u77e9\u9635\u4e3a\uff1a\" &lt;&lt; endl;\n\tfor (i = 0; i &lt; x; i++) {\n\t\tfor (j = 0; j &lt; y; j++) {\n\t\t\tcout &lt;&lt; a[i][j] &lt;&lt; \" \uff0c\";\n\t\t}\n\t\tcout &lt;&lt; endl;\n\t}\n\tint b[100][100];\n\tfor (i = 0; i &lt; x; i++) {\n\t\tfor (j = 0; j &lt; y; j++) {\n\t\t\tb[j][i] = a[i][j];\n\t\t}\n\t\tcout &lt;&lt; endl;\n\t}\n\tcout &lt;&lt; \"\u8f6c\u7f6e\u540e\u7684\u77e9\u9635\u4e3a\uff1a\" &lt;&lt; endl;\n\tfor (i = 0; i &lt; y; i++) {\n\t\tfor (j = 0; j &lt; x; j++) {\n\t\t\tcout &lt;&lt; b[i][j] &lt;&lt; \" \uff0c\";\n\t\t}\n\t\tcout &lt;&lt; endl;\n\t}\n}\n\n\/\/\u6c42\u5bf9\u89d2\u7ebf\u548c\nvoid duijiaoxianhe() {\n\tint a[200][200], i, j;\n\tint x, y, z=0;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u60a8\u8981\u5b9a\u4e49\u6570\u7ec4\u7684\u884c\u6570x=\";\n\tcin >> x;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u60a8\u8981\u5b9a\u4e49\u6570\u7ec4\u7684\u5217\u6570y=\";\n\tcin >> y;\n\tcout &lt;&lt; \"\u8bf7\u60a8\u8f93\u5165\" &lt;&lt; x * y &lt;&lt; \"\u4e2a\u6570\u5b57\uff1a\" &lt;&lt; endl;;\n\tfor (i = 0; i &lt; x; i++) {\n\t\tfor (j = 0; j &lt; y; j++) {\n\t\t\tcin >> a[i][j];\n\t\t}\n\t}\n\tcout &lt;&lt; \"\u60a8\u8f93\u5165\u7684\u77e9\u9635\u4e3a\uff1a\" &lt;&lt; endl;\n\tfor (i = 0; i &lt; x; i++) {\n\t\tfor (j = 0; j &lt; y; j++) {\n\t\t\tcout &lt;&lt; a[i][j] &lt;&lt; \" \uff0c\";\n\t\t}\n\t\tcout &lt;&lt; endl;\n\t}\n\t\n\tfor (i = 0; i &lt; x; i++) {\n\t\tz += a[i][i];\n\t}\n\tcout &lt;&lt; \"\u60a8\u6240\u8f93\u5165\u7684\u4e3b\u5bf9\u89d2\u5143\u7d20\u4e4b\u548c\u4e3a\uff1a\" &lt;&lt; z &lt;&lt; endl;\n}\n\n\/\/\u7edf\u8ba1\u5355\u8bcd\u4e2a\u6570\nvoid dancigeshu() {\n\tint sum = 0, i, word=0;\n\tcout &lt;&lt; \"\u4ece\u952e\u76d8\u8f93\u5165\u4e00\u884c\u5b57\u7b26\uff0c\u5355\u8bcd\u4e4b\u95f4\u7528\u7a7a\u683c\u5206\u9694\u5f00\u3002\" &lt;&lt; endl;\n\tcout &lt;&lt; \"\u8bf7\u5728\u6b64\u8f93\u5165\uff1a\";\n\tchar a[200];\n\tgets_s(a);\/\/\u4f1a\u81ea\u52a8\u4ee5\u4e3a\u6572\u8fdb\u53bb\u7684\u56de\u8f66\u7ed3\u675f\u8f93\u5165\u5b57\u7b26\u4e32\u3002 \n\tgets_s(a);\/\/\u4e0d\u89c4\u8303\u7684\u5c0f\u6280\u5de7 ^_^! \n\tfor (i = 0; a[i] != '\\0'; i++) {\n\t\t\/\/for(i=0; i&lt;strlen(str); i++){\n\t\tif (!((a[i] >= 'a' &amp;&amp; a[i] &lt;= 'z') || (a[i] >= 'A' &amp;&amp; a[i] &lt;= 'Z'))) {\/\/if(str[i]\u4e0d\u662f\u5b57\u6bcd)\n\t\t\tword = 0;\n\t\t}\n\t\telse if (word == 0) {\n\t\t\tword = 1;\n\t\t\tsum++;\n\t\t}\n\t}\n\tcout &lt;&lt; \"\\n\u60a8\u8f93\u5165\u4e86 \" &lt;&lt; sum &lt;&lt; \" \u4e2a\u5355\u8bcd\u3002\" &lt;&lt; endl;\n}\n\n\/\/\u7edf\u8ba1\u5355\u8bcd\u4e2a\u6570\uff0c\u5e76\u5c06\u5355\u8bcd\u8f93\u51fa\nvoid dancigeshu2() {\n\tchar ch[80];\n\tchar word[40][80];\/\/\u50a8\u5b58\u5206\u79bb\u51fa\u6765\u7684\u5355\u8bcd\n\tint i;\n\tint n, m;\/\/n\uff1aword[][]\u4e2d\u5b58\u7684\u5355\u8bcd\u4e2a\u6570\n\tn = 0;\n\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u5b57\u7b26\u4e32\uff0c\u5355\u8bcd\u4e4b\u95f4\u7a7a\u683c\u9694\u5f00:\";\n\tgets_s(ch);\n\tgets_s(ch);\n\t\/\/\u5224\u65ad\u7b2c\u4e00\u4e2a\u5b57\u7b26\uff0c\u4e0d\u5728\u5faa\u73af\u91cc\u5224\u65ad\u662f\u56e0\u4e3ai=0\u65f6ch[i-1]\u4e0b\u6807\u8d8a\u754c\n\tif (ch[0] >= 'a' &amp;&amp; ch[0] &lt;= 'z') {\n\t\tm = 0;\n\t\tword[n][m] = ch[0];\n\t\tm++;\n\t}\n\n\tfor (i = 1; ch[i] != '\\0'; i++) {\n\t\t\/\/if(ch[i]\u662f\u5355\u8bcd\u7684\u5f00\u59cb){\n\t\t\/\/if(chi[i]\u662f\u5b57\u6bcd\u4e14ch[i-1]\u4e0d\u662f\u5b57\u6bcd){\n\t\tif ((ch[i] >= 'a' &amp;&amp; ch[i] &lt;= 'z') &amp;&amp; !(ch[i - 1] >= 'a' &amp;&amp; ch[i - 1] &lt;= 'z')) {\n\t\t\tm = 0;\n\t\t\tword[n][m] = ch[i];\n\t\t\tm++;\n\t\t}\n\n\t\t\/\/if(chi[i]\u5728\u5355\u8bcd\u7684\u5185\u90e8){\n\t\t\/\/if(chi[i]\u662f\u5b57\u6bcd\u4e14ch[i-1]\u662f\u5b57\u6bcd){\n\t\tif ((ch[i] >= 'a' &amp;&amp; ch[i] &lt;= 'z') &amp;&amp; (ch[i - 1] >= 'a' &amp;&amp; ch[i - 1] &lt;= 'z')) {\n\t\t\tword[n][m] = ch[i];\n\t\t\tm++;\n\t\t}\n\n\t\t\/\/if(chi[i]\u662f\u5355\u8bcd\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u6bcd){\n\t\t\/\/if(chi[i]\u662f\u5b57\u6bcd\u4e14ch[i+1]\u4e0d\u662f\u5b57\u6bcd){\n\t\tif ((ch[i] >= 'a' &amp;&amp; ch[i] &lt;= 'z') &amp;&amp; !(ch[i + 1] >= 'a' &amp;&amp; ch[i + 1] &lt;= 'z')) {\n\t\t\tword[n][m] = '\\0';\n\t\t\tn++;\n\t\t}\n\t}\n\n\tfor (i = 0; i &lt; n; i++) {\n\t\tcout &lt;&lt; word[i] &lt;&lt; endl;\n\t}\n}\n\n\/\/\u5b66\u751f\u6210\u7ee9\u6392\u5e8f\nstruct Stu\n{\n\tint num;\n\tchar name[20];\n\tint score;\n};\nvoid chengjipaixu() {\n\tint i, j;\n\tstruct Stu student[10] = { {317,\"ax\",89},{318,\"bx\",50},{319,\"cx\",84},{320,\"dx\",70},{321,\"ex\",76},{322,\"fx\",99},{323,\"gx\",88},{324,\"hx\",121},{325,\"ix\",150},{326,\"jx\",77} };\n\tstruct Stu temp;\n\tfor (i = 0; i &lt; 10; i++)\n\t{\n\t\tfor (j = i + 1; j &lt; 10; j++)\n\t\t{\n\t\t\tif (student[i].score > student[j].score)\n\t\t\t{\n\t\t\t\ttemp = student[i];\n\t\t\t\tstudent[i] = student[j];\n\t\t\t\tstudent[j] = temp;\n\t\t\t}\n\t\t}\n\t}\n\tfor (i = 0; i &lt; 10; i++)\n\t{\n\t\tprintf(\"%d %6s  %d\\n\", student[i].num, student[i].name, student[i].score);\n\t}\n\tint a=0;\n\tfloat avg;\n\tfor (i = 0; i &lt; 10; i++) {\n\t\ta += student[i].score;\n\t}\n\tcout &lt;&lt; \"\u603b\u6210\u7ee9\u4e3a:\" &lt;&lt; (float)a &lt;&lt; endl;\n\tcout &lt;&lt; endl;\n\tavg = (float)a \/ 10;\n\tcout &lt;&lt; \"\u5e73\u5747\u5206\u4e3a\uff1a\" &lt;&lt; avg &lt;&lt; endl;\n}\n\nvoid function_23() {\n\tint i, a[10];\n\n\tFILE* fp;\n\terrno_t err;\n\terr= fopen_s(&amp;fp,\"D:\\\\my.txt\", \"r+\");\n\n\tif (fp)\n\t\tfclose(fp);\n\tfor (i = 0; i &lt; 10; i++) {\n\t\tfscanf_s(fp, \"%d\", &amp;a[i]);\n\t}\n\trewind(fp); \n\tfor (i = 0; i &lt; 10; i++)\n\t\tfprintf(fp, \"%d\\n\", a[i] + 10); \n\tfclose(fp); \n\tprintf(\"\u5df2\u5b8c\u6210\u64cd\u4f5c\\n\");\n}\n\nint main() {\n\tint a=0;\n\tcout &lt;&lt; \"********************************************************\" &lt;&lt; endl\n\t     &lt;&lt; \"*                        \u5c0f\u5c0f\u8ba1\u7b97\u5668                    *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  1.\u52a0\u6cd5                                              *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  2.\u51cf\u6cd5                                              *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  3.\u4e58\u6cd5                                              *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  4.\u9664\u6cd5                                              *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  5.\u53d6\u6a21\u8fd0\u7b97                                          *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  6.\u8ba1\u7b97\u5706\u9762\u79ef                                        *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  7.\u5224\u65ad\u6570\u5b57\u4f4d\u6570                                      *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  8.\u5224\u65ad\u95f0\u5e74                                          *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  9.\u6210\u7ee9\u8f6c\u6362                                          *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  10.\u8ba1\u7b97\u4ece1\u5230\u8f93\u5165\u6570\u4e4b\u95f4\u7684\u5947\u6570\u548c(for)                 *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  11.\u8ba1\u7b97\u4ece1\u5230\u8f93\u5165\u6570\u4e4b\u95f4\u7684\u5076\u6570\u548c(while)               *\" &lt;&lt; endl\n         &lt;&lt; \"*  12.\u8f93\u51fa\u4ece1\u5230\u8f93\u5165\u6570\u4e4b\u95f4\u6240\u67093\u7684\u500d\u6570 \uff08do-while\uff09      *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  13.\u6c42\u5373\u88ab3\u6574\u9664\u53c8\u88ab5\u6574\u9664\u7684\u6570                         *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  14.\u6c42\u6c34\u4ed9\u82b1\u6570                                       *\" &lt;&lt; endl\n     \t &lt;&lt; \"*  15.\u6c42\u6700\u5927\u503c                                         *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  16.\u6c42\u6700\u5927\u6700\u5c0f\u503c                                     *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  17.\u5192\u6ce1\u6392\u5e8f                                         *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  18.\u77e9\u9635\u8f6c\u7f6e                                         *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  19.\u6c42\u5bf9\u89d2\u7ebf\u548c                                       *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  20.\u7edf\u8ba1\u5355\u8bcd\u4e2a\u6570                                     *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  21.\u7edf\u8ba1\u5355\u8bcd\u4e2a\u6570\uff0c\u5e76\u8f93\u51fa\u5355\u8bcd                         *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  22.\u5b66\u751f\u6210\u7ee9\u6392\u5e8f                                     *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  23.\u5b66\u751f\u6210\u7ee9\u666e\u6da810\u5206                                 *\" &lt;&lt; endl\n\t     &lt;&lt; \"*  24.\u9000\u51fa                                             *\" &lt;&lt; endl\n\t     &lt;&lt; \"********************************************************\" &lt;&lt; endl;\n\t\n\t  while (a != 24) {\n\t\tcout &lt;&lt; endl;\n\t\tcout &lt;&lt; \"\u8bf7\u8f93\u5165\u9009\u9879\u524d\u5bf9\u5e94\u7684\u5e8f\u53f7\uff0c\u5c06\u6267\u884c\u76f8\u5e94\u64cd\u4f5c\uff1a\";\n\t\tcin >> a;\n\t\tswitch (a) {\n\t\tcase 1:jiafa(); break;\n\t\tcase 2:jianfa(); break;\n\t\tcase 3:chengfa(); break;\n\t\tcase 4:chufa(); break;\n\t\tcase 5:qumo(); break;\n\t\tcase 6:yuanmianji(); break;\n\t\tcase 7:weishu(); break;\n\t\tcase 8:runnian(); break;\n\t\tcase 9:chengji(); break;\n\t\tcase 10:jishuhe(); break;\n\t\tcase 11:oushuhe(); break;\n\t\tcase 12:sanbeishu(); break;\n\t\tcase 13:zhengchushu(); break;\n\t\tcase 14:shuixianjhua(); break;\n\t\tcase 15:zuidazhi(); break;\n\t\tcase 16:maxandmin();break; \n\t\tcase 17:maopao(); break;\n\t\tcase 18:juzenzhuanzhi(); break;\n\t\tcase 19:duijiaoxianhe(); break;\n\t\tcase 20:dancigeshu(); break;\n\t\tcase 21:dancigeshu2(); break;\n\t\tcase 22:chengjipaixu(); break;\n\t\tcase 23:function_23(); break;\n\t\t}\n\t}\n\tcout &lt;&lt; endl;\n\tcout &lt;&lt; \"--------------------------------\" &lt;&lt; endl\n\t     &lt;&lt; \"-            \u5df2\u9000\u51fa            -\" &lt;&lt; endl\n\t     &lt;&lt; \"--------------------------------\" &lt;&lt; endl;\n}<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n<div class=\"clearfix\"><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":1,"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/posts\/142\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wangsilin.cn\/index.php\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}