{"id":320,"date":"2023-02-22T02:34:21","date_gmt":"2023-02-22T10:34:21","guid":{"rendered":"http:\/\/bitas.net.cn\/?page_id=320"},"modified":"2023-02-22T02:34:30","modified_gmt":"2023-02-22T10:34:30","slug":"115-2","status":"publish","type":"page","link":"http:\/\/bitas.net.cn\/index.php\/sourcecode\/115-2\/","title":{"rendered":"115 \u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h>\n#include &lt;stdlib.h>\n\nvoid life(int times)\n{\n    int i = 0;\n    static int si = 0;\n    char *buf = malloc(100);\n    sprintf(buf, \n        \"%2d times life: \"\n        \"i=%2d\",\n        ++si, ++i);\n    printf(\"%s\", buf);\n    free(buf);\n    int n = times % 2 + 1;\n    char ca&#91;n];\n    if (times % 2) {\n        ca&#91;0] = '.';\n        putchar(ca&#91;0]);\n    }   \n    else {\n        ca&#91;0] = '.';\n        ca&#91;1] = '|';\n        putchar(ca&#91;0]);\n        putchar(ca&#91;1]);\n    }   \n    putchar('\\n');\n}\n\nint main(int argc, char *argv&#91;])\n{\n    for (int j = 0; j &lt; 10; j++)\n        life(j+1);\n\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":127,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-320","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":1,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/320\/revisions"}],"predecessor-version":[{"id":321,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/320\/revisions\/321"}],"up":[{"embeddable":true,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/127"}],"wp:attachment":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/media?parent=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}