{"id":1428,"date":"2024-04-05T07:01:48","date_gmt":"2024-04-04T23:01:48","guid":{"rendered":"https:\/\/wp.minicoda.com\/?p=1428"},"modified":"2024-09-25T20:23:38","modified_gmt":"2024-09-25T12:23:38","slug":"b%e8%af%ad%e8%a8%80%e4%bb%a3%e7%a0%81%e5%ae%9e%e4%be%8b","status":"publish","type":"post","link":"https:\/\/wp.minicoda.com\/index.php\/b%e8%af%ad%e8%a8%80%e4%bb%a3%e7%a0%81%e5%ae%9e%e4%be%8b\/","title":{"rendered":"B\u8bed\u8a00\u4ee3\u7801\u5b9e\u4f8b"},"content":{"rendered":"\n<p>\u5982\u4e0b\u662fKen Thompson\u7684<em>Users' Reference to B<\/em>\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u548cC\u8bed\u8a00\u5f88\u63a5\u8fd1\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* The following program will calculate the constant e-2 to about\n   4000 decimal digits, and print it 50 characters to the line in\n   groups of 5 characters.  The method is simple output conversion\n   of the expansion\n     1\/2! + 1\/3! + ... = .111....\n   where the bases of the digits are 2, 3, 4, . . . *\/\n\nmain() {\n\textrn putchar, n, v;\n\tauto i, c, col, a;\n\n\ti = col = 0;\n\twhile(i&lt;n)\n\t\tv&#91;i++] = 1;\n\twhile(col&lt;2*n) {\n\t\ta = n+1;\n\t\tc = i = 0;\n\t\twhile (i&lt;n) {\n\t\t\tc =+ v&#91;i] *10;\n\t\t\tv&#91;i++]  = c%a;\n\t\t\tc =\/ a--;\n\t\t}\n\n\t\tputchar(c+'0');\n\t\tif(!(++col%5))\n\t\t\tputchar(col%50?' ': '*n');\n\t}\n\tputchar('*n*n');\n}\nv&#91;2000];\nn 2000;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4e0b\u662fKen Thompson\u7684Users' Reference to B\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u548cC\u8bed\u8a00\u5f88\u63a5\u8fd1\u4e86\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[345],"tags":[],"class_list":["post-1428","post","type-post","status-publish","format-standard","hentry","category-345"],"views":127,"_links":{"self":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/comments?post=1428"}],"version-history":[{"count":1,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1428\/revisions"}],"predecessor-version":[{"id":1429,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1428\/revisions\/1429"}],"wp:attachment":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/media?parent=1428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/categories?post=1428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/tags?post=1428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}