{"id":382,"date":"2023-06-21T17:59:26","date_gmt":"2023-06-21T09:59:26","guid":{"rendered":"https:\/\/blog.byzhb.top\/?p=382"},"modified":"2023-06-22T16:48:09","modified_gmt":"2023-06-22T08:48:09","slug":"sjjgw","status":"publish","type":"post","link":"https:\/\/blog.byzhb.top\/index.php\/2023\/06\/21\/sjjgw\/","title":{"rendered":"\u3010\u6570\u636e\u7ed3\u6784\u3011\u5173\u4e8e\u65e0\u5934\u94fe\u8868\u63d2\u5165\u8282\u70b9"},"content":{"rendered":"<h1>\u524d\u8a00<\/h1>\n<p>\u6700\u8fd1\u505a\u6bd5\u8bbe\u65f6\u53d1\u73b0\u4e86\u4e00\u4e2a\u95ee\u9898\uff0c\u65e0\u5934\u94fe\u8868\u5e76\u4e0d\u80fd\u901a\u8fc7\u7ed3\u6784\u4f53\u6307\u9488\u8fdb\u884c\u51fd\u6570\u4f20\u53c2\u63d2\u5165\u6570\u636e\uff0c\u8fd9\u79cd\u65b9\u6cd5\u53ea\u9002\u7528\u4e8e\u9644\u5e26\u5934\u7ed3\u70b9\u7684\u94fe\u8868\uff0c<\/p>\n<h1>\u9519\u8bef\u793a\u4f8b<\/h1>\n<p><strong>\u5047\u8bbe\u7ed3\u6784\u4f53\u4e3a\uff1a<\/strong><\/p>\n<pre><code class=\"language-c\">typedef struct link\n{\n    int data\uff1b\n    struct link *next;\n}Listnode<\/code><\/pre>\n<p><strong>\u63d2\u5165\u6570\u636e\u7684\u51fd\u6570\u4e3a\uff1a<\/strong><\/p>\n<pre><code class=\"language-c\">\/\/\u9519\u8bef\u793a\u4f8b\nvoid fun(Listnode *head,int n)\n{\n    Listnode *cur=head;\n    Listnode *tmp=(Listnode*)malloc(sizeof(Listnode));\n    scanf(&quot;%d&quot;,&amp;tmp-&gt;data);\n    if(cur==NULL){\n    cur=tmp;\n    }\n    else{\n     while(cur!=NULL)\n     {\n        cur=cur-&gt;next;\n     }\n     cur-&gt;next=NULL;\n     }\n}<\/code><\/pre>\n<p><strong>\u4e3b\u51fd\u6570\u4e3a\uff1a<\/strong><\/p>\n<pre><code class=\"language-c\">\/\/\u65e0\u5934\u8282\u70b9\u7684\u94fe\u8868\u521b\u5efa\nListnode *head;\nhead=(Listnode*)malloc(sizeof(Listnode));\nfun(head,4);<\/code><\/pre>\n<blockquote>\n<p>\u8fd9\u6837\u662f\u884c\u4e0d\u901a\u7684\uff0c\u8fd9\u79cd\u5b9a\u4e49\u7ed3\u6784\u4f53\u6307\u9488\u4f20\u53c2\u7684\u65b9\u6cd5\u53ea\u53ef\u7528\u4e8e\u9644\u5e26\u5934\u7ed3\u70b9\u7684\u94fe\u8868\uff0c\u5bf9\u4e8e\u65e0\u5934\u8282\u70b9\u94fe\u8868\u4e0d\u9002\u7528<\/p>\n<\/blockquote>\n<p><strong>\u9644\u5e26\u5934\u7ed3\u70b9\u7684\u94fe\u8868\u521b\u5efa\u662f\u8fd9\u6837\u7684\uff1a<\/strong><\/p>\n<pre><code class=\"language-c\">Listnode *head;\nhead=(Listnode*)malloc(sizeof(Listnode));\nhead-&gt;next=NULL;<\/code><\/pre>\n<h1>\u95ee\u9898\u5206\u6790<\/h1>\n<p>\u7ecf\u8fc7\u4e00\u4e0b\u5348\u7684\u51a5\u60f3\u4ee5\u53ca\u6d4b\u8bd5\u624d\u660e\u767d\uff0c\u8fd9\u79cd\u5b9a\u4e49\u7ed3\u6784\u4f53\u6307\u9488\u51fd\u6570\u6570\u4f20\u53c2\u7684\u65b9\u6cd5\uff0c\u53ea\u9002\u7528\u4e8e\u9644\u5e26\u5934\u7ed3\u70b9\u7684\u94fe\u8868\uff0c\u56e0\u4e3a\u8ba4\u771f\u5b66\u8fc7C\u8bed\u8a00\u7684\u90fd\u77e5\u9053\uff0c\u51fd\u6570\u4f20\u53c2\u7684\u53c2\u6570\u53ea\u662f\u5b9e\u53c2\u7684\u62f7\u8d1d\uff08\u53eb\u505a\u5f62\u53c2\uff09\uff0c\u5f62\u53c2\u5728\u51fd\u6570\u6267\u884c\u5b8c\u6bd5\u540e\u4fbf\u4ece\u6808\u5185\u9500\u6bc1\uff0c\u65e0\u6cd5\u6539\u53d8\u5916\u90e8\u5b9e\u53c2<br \/>\n\u5982\u679c\u60f3\u8981\u6539\u53d8\u5916\u90e8\u5f62\u53c2\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u6307\u9488\u4f20\u9012\u53c2\u6570\u5730\u5740\uff0c\u4f8b\u5982:<\/p>\n<pre><code class=\"language-c\">void fun1(int *a,int *b)\n{\n    *a=*a+1;\n    *b=*b+1;\n}\nfun(&amp;a,&amp;b);<\/code><\/pre>\n<p>\u7531\u6b64\u53ef\u5f97\uff0c\u5728\u4e0a\u6587\u4e2d\u5b9a\u4e49\u7684\u51fd\u6570void fun(Listnode *head,int n)\u53ea\u662f\u4f20\u9012\u7684\u7ed3\u6784\u4f53\u6307\u9488\u5934\u7ed3\u70b9\u7684\u5f62\u53c2,\u5728\u51fd\u6570\u91cc\u8fdb\u884c\u64cd\u4f5c\u7684\u53ea\u662f\u5934\u8282\u70b9\u7684\u4e00\u4efd\u62f7\u8d1d\uff0c\u5982\u679c\u51fd\u6570\u8981\u5bf9\u5934\u7ed3\u70b9\u6570\u636e\u57df\u8fdb\u884c\u6539\u53d8\uff0c\u5e76\u4e0d\u4f1a\u5bf9\u51fd\u6570\u5916\u7684\u94fe\u8868\u5934\u7ed3\u70b9\u8fdb\u884c\u6539\u53d8.<br \/>\n\u4f46\u662f\u5047\u5982\u6211\u4eec\u4f20\u5165\u7684\u662f\u9644\u5e26\u5934\u7ed3\u70b9\u7684\u94fe\u8868\uff0c\u90a3\u4e48\u5c31\u4e0d\u9700\u8981\u5bf9\u5934\u7ed3\u70b9\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\uff0c\u53ea\u9700\u5bf9\u5934\u7ed3\u70b9\u6307\u5411\u7684\u4e0b\u9762\u7684\u8282\u70b9\u8fdb\u884c\u64cd\u4f5c<br \/>\n\u4f20\u5165\u7684\u5934\u8282\u70b9\u867d\u7136\u662f\u5f62\u53c2\uff0c\u65e0\u8bba\u662f\u5f62\u53c2\u8fd8\u662f\u5b9e\u53c2\uff0c\u5b83\u4eecnext\u6307\u9488\u6307\u5411\u7684\u7a7a\u95f4\u90fd\u662f\u76f8\u540c\u7684\uff0c\u4f46\u5bf9\u4e8e\u65e0\u5934\u7ed3\u70b9\u7684\u94fe\u8868\u6211\u4eec\u5c31\u9700\u8981\u4f20\u5165\u6307\u9488\u7ed3\u6784\u4f53\u7684\u6307\u9488\uff0c\u5c06\u6307\u9488\u7ed3\u6784\u4f53\u7684\u5730\u5740\u4f20\u5165\u51fd\u6570\uff0c\u8fd9\u6837\u624d\u80fd\u771f\u6b63\u6539\u53d8\u8fd9\u4e2a\u6307\u9488\u7ed3\u6784\u4f53<\/p>\n<h1>\u6b63\u786e\u4ee3\u7801<\/h1>\n<p>\u8be5\u4ee3\u7801\u901a\u8fc7\u5b9a\u4e49\u4e8c\u7ea7\u6307\u9488\uff0c\u4f20\u5165\u4e86\u6307\u9488\u7ed3\u6784\u4f53\u7684\u5730\u5740\uff0c\u53ef\u5bf9\u5934\u8282\u70b9\u8fdb\u884c\u66f4\u6539<\/p>\n<pre><code class=\"language-c\">void add(Listnode** head_ptr) \n{\n    float sr,so=0.01;\n    int a;\n    Ctf* new_ctf = (Ctf*) malloc(sizeof(Ctf));\n    new_ctf-&gt;next = NULL;\n    scanf(&quot;%d&quot;, &amp;new_ctf-&gt;data); \n    if (*head_ptr == NULL)\n    {\n        *head_ptr = new_ctf;\n    } \n    else \n    {\n        Ctf *current = *head_ptr;\n        while (current-&gt;next != NULL) \n        {\n            current = current-&gt;next;\n        }\n        current-&gt;next = new_ctf;\n    }\n}<\/code><\/pre>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u5370\u8c61\u4e2d\u6570\u6784\u8001\u5e08\u597d\u50cf\u987a\u4fbf\u8bb2\u8fc7\uff0c\u540e\u6094\u6ca1\u4ed4\u7ec6\u542c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8ba8\u8bba\u4e86\u5728C\u8bed\u8a00\u4e2d\u4f7f\u7528\u7ed3\u6784\u4f53\u6307\u9488\u4f20\u53c2\u63d2\u5165\u6570\u636e\u5230\u94fe\u8868\u65f6\u7684\u95ee\u9898\uff0c\u7279\u522b\u662f\u9488\u5bf9\u65e0\u5934\u8282\u70b9\u548c\u9644\u5e26\u5934\u7ed3\u70b9\u7684\u94fe\u8868\u3002\u6587\u7ae0\u901a\u8fc7\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\u548c\u5206\u6790\uff0c\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u5728\u65e0\u5934\u8282\u70b9\u7684\u94fe\u8868\u4e2d\u65e0\u6cd5\u901a\u8fc7\u7ed3\u6784\u4f53\u6307\u9488\u8fdb\u884c\u51fd\u6570\u4f20\u53c2\u63d2\u5165\u6570\u636e\u3002\u540c\u65f6\uff0c\u4f5c\u8005\u8fd8\u4ecb\u7ecd\u4e86\u6b63\u786e\u7684\u65b9\u6cd5\uff0c\u5373\u4f7f\u7528\u4e8c\u7ea7\u6307\u9488\u6765\u4f20\u9012\u6307\u5411\u6307\u9488\u7ed3\u6784\u4f53\u7684\u6307\u9488\uff0c\u4ece\u800c\u80fd\u591f\u771f\u6b63\u6539\u53d8\u6307\u9488\u7ed3\u6784\u4f53<\/p>\n","protected":false},"author":1,"featured_media":384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[31,30],"class_list":["post-382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-32","tag-31","tag-30"],"_links":{"self":[{"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/posts\/382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/comments?post=382"}],"version-history":[{"count":3,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/posts\/382\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/posts\/382\/revisions\/386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/media\/384"}],"wp:attachment":[{"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/media?parent=382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/categories?post=382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.byzhb.top\/index.php\/wp-json\/wp\/v2\/tags?post=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}