{"id":118,"date":"2023-04-03T16:31:11","date_gmt":"2023-04-03T08:31:11","guid":{"rendered":"https:\/\/solost.cn\/?p=118"},"modified":"2023-04-03T16:31:11","modified_gmt":"2023-04-03T08:31:11","slug":"225","status":"publish","type":"post","link":"https:\/\/solost.cn\/?p=118","title":{"rendered":"\u9ad8\u7cbe\u5ea6\u9664\u6cd5"},"content":{"rendered":"<pre><code class=\"lang-cpp\">#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include &lt;algorithm&gt;\n\nusing namespace std;\n\nvector&lt;int&gt; div(vector&lt;int&gt; &amp;A, int b, int &amp;r)\n{\n    vector&lt;int&gt; C;\n    r = 0;\n    for (int i = A.size() - 1; i &gt;= 0; i -- )\n    {\n        r = r * 10 + A[i];\n        C.push_back(r \/ b);\n        r %= b;\n    }\n    reverse(C.begin(), C.end());\n    while (C.size() &gt; 1 &amp;&amp; C.back() == 0) C.pop_back();\n    return C;\n}\n\nint main()\n{\n    string a;\n    vector&lt;int&gt; A;\n\n    int B;\n    cin &gt;&gt; a &gt;&gt; B;\n    for (int i = a.size() - 1; i &gt;= 0; i -- ) A.push_back(a[i] - &#039;0&#039;);\n\n    int r;\n    auto C = div(A, B, r);\n\n    for (int i = C.size() - 1; i &gt;= 0; i -- ) cout &lt;&lt; C[i];\n\n    cout &lt;&lt; endl &lt;&lt; r &lt;&lt; endl;\n\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; using namespace std; vector&lt;int&gt; div(vector&lt;int&gt; &amp;A, int b, int &amp;r) { vector&lt;int&gt; C; r = 0; for (int i = A.size() - 1; i &gt;= 0; i -- ) { r = r * 10 + A[i]; C.push_back(r \/ b); r %= b; } reverse(C.begin(), C.end()); while (C.size() &gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72],"tags":[29],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-acm","tag-29"],"_links":{"self":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":0,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"wp:attachment":[{"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}