{"id":7857,"date":"2007-12-22T03:05:00","date_gmt":"2007-12-22T03:05:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=7857"},"modified":"2007-12-22T03:05:00","modified_gmt":"2007-12-22T03:05:00","slug":"%ec%9e%90%ea%b8%b0%ec%b0%b8%ec%a1%b0-%ea%b5%ac%ec%a1%b0%ec%b2%b4-%ec%98%88%ec%a0%9c","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=7857","title":{"rendered":"\uc790\uae30\ucc38\uc870 \uad6c\uc870\uccb4 \uc608\uc81c"},"content":{"rendered":"<div class=\"desc\">\n        \uc65c \uc774 \ud504\ub85c\uadf8\ub7a8\uc744 \ub9cc\ub4e4\uc5c8\ub294\uc9c0 \ubb3b\uc9c0 \ub9d0\uc790.<br \/>\n        <br \/>\n        \uc774 \ud504\ub85c\uadf8\ub7a8\uc740 public domain \ub77c\uc774\uc13c\uc2a4\uc774\ub2e4. \ucd9c\ucc98\ub97c \ubc1d\ud788\uc9c0 \uc54a\uace0\ub3c4 \ub204\uad6c\ub098 \uc790\uc720\ub86d\uac8c \uc774\uc6a9\ud560 \uc218 \uc788\uace0, \uc0c1\uc5c5\uc801 \ubaa9\uc801\uc73c\ub85c \uc0ac\uc6a9\ud574\ub3c4 \ubb34\ubc29\ud558\ub2e4.<\/p>\n<blockquote><p>\n         #include<stdio.h><br \/>\n         <br \/>\n         #include<stdlib.h><br \/>\n         <br \/>\n         #include<string.h><\/p>\n<p>         struct person{<br \/>\n         <br \/>\n         char name[30];<br \/>\n         <br \/>\n         char tel[14];<br \/>\n         <br \/>\n         int hour;<br \/>\n         <br \/>\n         int payment;<br \/>\n         <br \/>\n         struct person *next;<br \/>\n         <br \/>\n         };<\/p>\n<p>         main()<br \/>\n         <br \/>\n         {<br \/>\n         <br \/>\n         FILE *data;<br \/>\n         <br \/>\n         struct person dummy;<br \/>\n         <br \/>\n         struct person *start=&dummy;<br \/>\n         <br \/>\n         struct person *wkdata;<br \/>\n         <br \/>\n         struct person *wp;<br \/>\n         <br \/>\n         struct person *best;<br \/>\n         <br \/>\n         char name[30]=&#8221; &#8220;;<br \/>\n         <br \/>\n         char buf[20];<br \/>\n         <br \/>\n         char tel_input[14]=&#8221; &#8220;;<br \/>\n         <br \/>\n         int hour_input=0;<br \/>\n         <br \/>\n         int payment_input=0;<br \/>\n         <br \/>\n         int i=0;<br \/>\n         <br \/>\n         int totalpay=0;<\/p>\n<p>         start=&dummy;<br \/>\n         <br \/>\n         start->next=NULL;<\/p>\n<p>         printf(&#8220;put your data in\\n&#8221;);<br \/>\n         <br \/>\n         while(1){<br \/>\n         <br \/>\n         printf(&#8220;name:&#8221;);<br \/>\n         <br \/>\n         gets(name);<br \/>\n         <br \/>\n         if(strcmp(name,&#8221;&#8221;)==0) break;<br \/>\n         <br \/>\n         printf(&#8220;phone:&#8221;);<br \/>\n         <br \/>\n         gets(tel_input);<br \/>\n         <br \/>\n         printf(&#8220;work hour:&#8221;);<br \/>\n         <br \/>\n         gets(buf);<br \/>\n         <br \/>\n         hour_input=atoi(buf);<br \/>\n         <br \/>\n         printf(&#8220;pay per hour:&#8221;);<br \/>\n         <br \/>\n         gets(buf);<br \/>\n         <br \/>\n         payment_input=atoi(buf);<\/p>\n<p>\n         wkdata=(struct person *)malloc(sizeof(struct person));<br \/>\n         <br \/>\n         if(wkdata==NULL){<br \/>\n         <br \/>\n         printf(&#8220;Memory allocation cannot be done\\n&#8221;);<br \/>\n         <br \/>\n<script>\n          <!--\nD([\"mb\",\" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit(1);\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}\\u003cbr \/\\>\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;strcpy(wkdata->name,name);\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;strcpy(wkdata->tel,tel_input);\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;wkdata->hour\\u003dhour_input;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;wkdata->payment\\u003dpayment_input;\\u003cbr \/\\>\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;for(wp\\u003dstart; wp->next !\\u003d NULL; wp\\u003dwp->next){\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(payment_input*hour_input>wp\\u003cwbr \/\\>->next->payment*wp->next->hour\\u003cwbr \/\\>){\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wkdata->next \\u003d wp->next;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wp->next \\u003d wkdata;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}\\u003cbr \/\\>\\u003cbr \/\\>\\u003cbr \/\\> &nbsp; &nbsp;if(wp->next\\u003d\\u003dNULL){\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;wkdata->next\\u003dNULL;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;wp->next\\u003dwkdata;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;}\\u003cbr \/\\> &nbsp; &nbsp;}\\u003cbr \/\\>\\u003cbr \/\\> &nbsp; &nbsp;data\\u003dfopen(\"\uace0\uc2b9\ud76c.txt\",\"w\");\\u003cbr \/\\> &nbsp; &nbsp;fprintf(data,\"Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Phone &nbsp; &nbsp; &nbsp; &nbsp; Working\\u003cbr \/\\>Hour &nbsp; &nbsp; pay\/hour Total\\u003cbr \/\\>Pay\\\\n\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003cwbr \/\\>\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003cwbr \/\\>\\u003d\\u003d\\u003d\\u003d\\\\n\");\\u003cbr \/\\> &nbsp; &nbsp;fclose(data);\\u003cbr \/\\> &nbsp; &nbsp;for(wp\\u003dstart->next;wp!\\u003dNULL;wp\\u003cwbr \/\\>\\u003dwp->next){\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;data\\u003dfopen(\"\uace0\uc2b9\ud76c.txt\",\"a+\");\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;fprintf(data,\"%-30s%-14s\\\\t%12d\\u003cwbr \/\\>\\\\t%8d\\\\t%8d\\\\n\",\\u003cbr \/\\>wp->name,wp->tel,wp->hour,wp-\\u003cwbr \/\\>>payment,wp->hour*wp->payment)\\u003cwbr \/\\>;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;fclose(data);\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;i++;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;totalpay+\\u003dwp->hour*wp->payment\\u003cwbr \/\\>\",1]\n);\n\n\/\/-->\n         <\/script><br \/>\n         exit(1);<br \/>\n         <br \/>\n         }<\/p>\n<p>         strcpy(wkdata->name,name);<br \/>\n         <br \/>\n         strcpy(wkdata->tel,tel_input);<br \/>\n         <br \/>\n         wkdata->hour=hour_input;<br \/>\n         <br \/>\n         wkdata->payment=payment_input;<\/p>\n<p>         for(wp=start; wp->next != NULL; wp=wp->next){<br \/>\n         <br \/>\n         if(payment_input*hour_input>wp<\/p>\n<div style=\"direction: ltr;\">\n<wbr><br \/>\n           ->next->payment*wp->next->hour<br \/>\n           <wbr><br \/>\n            ){<br \/>\n            <br \/>\n            wkdata->next = wp->next;<br \/>\n            <br \/>\n            wp->next = wkdata;<br \/>\n            <br \/>\n            break;<br \/>\n            <br \/>\n            }<br \/>\n            <br \/>\n            }<\/p>\n<p>\n            if(wp->next==NULL){<br \/>\n            <br \/>\n            wkdata->next=NULL;<br \/>\n            <br \/>\n            wp->next=wkdata;<br \/>\n            <br \/>\n            }<br \/>\n            <br \/>\n            }<\/p>\n<p>            data=fopen(&#8221;<br \/>\n            <span class=\"st\" id=\"st\" name=\"st\"><br \/>\n             data<br \/>\n            <\/span><br \/>\n            .txt&#8221;,&#8221;w&#8221;);<br \/>\n            <br \/>\n            fprintf(data,&#8221;Name                          Phone         Working<br \/>\n            <br \/>\n            Hour     pay\/hour Total<br \/>\n            <br \/>\n            Pay\\n=========================<br \/>\n            <wbr><br \/>\n             ==============================<br \/>\n             <wbr><br \/>\n              ====\\n&#8221;);<br \/>\n              <br \/>\n              fclose(data);<br \/>\n              <br \/>\n              for(wp=start->next;wp!=NULL;wp<br \/>\n              <wbr><br \/>\n               =wp->next){<br \/>\n               <br \/>\n               data=fopen(&#8221;<br \/>\n               <span class=\"st\" id=\"st\" name=\"st\"><br \/>\n                data<br \/>\n               <\/span><br \/>\n               .txt&#8221;,&#8221;a+&#8221;);<br \/>\n               <br \/>\n               fprintf(data,&#8221;%-30s%-14s\\t%12d<br \/>\n               <wbr><br \/>\n                \\t%8d\\t%8d\\n&#8221;,<br \/>\n                <br \/>\n                wp->name,wp->tel,wp->hour,wp-<br \/>\n                <wbr><br \/>\n                 >payment,wp->hour*wp->payment)<br \/>\n                 <wbr><br \/>\n                  ;<br \/>\n                  <br \/>\n                  fclose(data);<br \/>\n                  <br \/>\n                  i++;<br \/>\n                  <br \/>\n                  totalpay+=wp->hour*wp->payment<br \/>\n                  <wbr><br \/>\n<script>\n                    <!--\nD([\"mb\",\";\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;}\\u003cbr \/\\> &nbsp; &nbsp;data\\u003dfopen(\"\uace0\uc2b9\ud76c.txt\",\"a\");\\u003cbr \/\\> &nbsp; &nbsp;fprintf(data,\"\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003cwbr \/\\>\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003cwbr \/\\>\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\u003d\\\\n\");\\u003cbr \/\\> &nbsp; &nbsp;fclose(data);\\u003cbr \/\\> &nbsp; &nbsp;best\\u003dstart;\\u003cbr \/\\>\\u003cbr \/\\> &nbsp; &nbsp;for(wp\\u003dstart->next;wp!\\u003dNULL;wp\\u003cwbr \/\\>\\u003dwp->next){\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;if(wp->payment>best->payment)\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;best\\u003dwp;\\u003cbr \/\\> &nbsp; &nbsp; &nbsp; &nbsp;}\\u003cbr \/\\>\\u003cbr \/\\>\\u003cbr \/\\> &nbsp; &nbsp;printf(\"\\\\n\uc785\ub825\ub41c \uc9c1\uc6d0\uc218\ub294 \ubaa8\ub450 %d\uba85 \uc785\ub2c8\ub2e4.\\\\n\", i);\\u003cbr \/\\> &nbsp; &nbsp;printf(\"\uc2dc\uac04\ub2f9 \uc784\uae08\uc774 \uac00\uc7a5 \ub192\uc740 \uc9c1\uc6d0\uc740 %d\uc6d0\uc744 \ubc1b\ub294 %s\\u003cbr \/\\>\uc785\ub2c8\ub2e4.\\\\n\",start->next->payment\\u003cwbr \/\\>,start->next->name);\\u003cbr \/\\> &nbsp; &nbsp;printf(\"\ud604\uc7ac \uc9c0\ubd88\ud574\uc57c \ud560 \uace0\uc6a9\uc790 \uc784\uae08\ud569\uacc4\ub294 %d\uc6d0\uc785\ub2c8\ub2e4.\\\\n\",totalpay);\\u003cbr \/\\>\\u003cbr \/\\>}\\u003cbr \/\\>\\u003c\/div\\>\",0]\n);\n\n\/\/-->\n                   <\/script><br \/>\n                   ;<br \/>\n                   <br \/>\n                   }<br \/>\n                   <br \/>\n                   data=fopen(&#8221;<br \/>\n                   <span class=\"st\" id=\"st\" name=\"st\"><br \/>\n                    data<br \/>\n                   <\/span><br \/>\n                   .txt&#8221;,&#8221;a&#8221;);<br \/>\n                   <br \/>\n                   fprintf(data,&#8221;================<br \/>\n                   <wbr><br \/>\n                    ==============================<br \/>\n                    <wbr><br \/>\n                     =============\\n&#8221;);<br \/>\n                     <br \/>\n                     fclose(data);<br \/>\n                     <br \/>\n                     best=start;<\/p>\n<p>                     for(wp=start->next;wp!=NULL;wp<br \/>\n                     <wbr><br \/>\n                      =wp->next){<br \/>\n                      <br \/>\n                      if(wp->payment>best->payment)<br \/>\n                      <br \/>\n                      best=wp;<br \/>\n                      <br \/>\n                      }<\/p>\n<p>\n                      printf(&#8220;\\nTotal workers are %d\\n&#8221;, i);<br \/>\n                      <br \/>\n                      printf(&#8220;The highest paid person of %dwon is %s<br \/>\n                      <br \/>\n                      .\\n&#8221;,start->next->payment<br \/>\n                      <wbr><br \/>\n                       ,start->next->name);<br \/>\n                       <br \/>\n                       printf(&#8220;Sum of total payment is %d.\\n&#8221;,totalpay);<\/p>\n<p>                       }<br \/>\n                      <\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr><br \/>\n<\/wbr>\n<\/div>\n<\/blockquote>\n<div style=\"direction: ltr;\">\n         \ubb3c\ub860, \uc5b4\ub514\uc11c \ub9ce\uc774 \ubcf4\ub358 \ud504\ub85c\uadf8\ub7a8\uc774\ub2e4 \uc2f6\uc740 \uc0ac\ub78c\ub4e4\uc740 \ud2b9\uc815 \uc0ac\ub78c\ub4e4\uc774\uaca0\uc9c0\ub9cc&#8230;;<\/p>\n<p>\n<\/div>\n<div style=\"width:100%;margin-top:30px;clear:both;height:30px\">\n<div style=\"width:31px;float:left;\">\n<a href=\"\/toolbar\/popup\/abuseReport\/?entryId=651\" onclick=\"window.open(this.href, 'tistoryThisBlogPopup', 'width=550, height=510, toolbar=no, menubar=no, status=no, scrollbars=no'); return false;\"><br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\uc2e0\uace0\" src=\"https:\/\/i0.wp.com\/t1.daumcdn.net\/tistory_admin\/static\/ico\/ico_spam_report.png\" style=\"border:0\"\/><br \/>\n<\/a>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\uc65c \uc774 \ud504\ub85c\uadf8\ub7a8\uc744 \ub9cc\ub4e4\uc5c8\ub294\uc9c0 \ubb3b\uc9c0 \ub9d0\uc790. \uc774 \ud504\ub85c\uadf8\ub7a8\uc740 public domain \ub77c\uc774\uc13c\uc2a4\uc774\ub2e4. \ucd9c\ucc98\ub97c \ubc1d\ud788\uc9c0 \uc54a\uace0\ub3c4 \ub204\uad6c\ub098 \uc790\uc720\ub86d\uac8c \uc774\uc6a9\ud560 \uc218 \uc788\uace0, \uc0c1\uc5c5\uc801 \ubaa9\uc801\uc73c\ub85c \uc0ac\uc6a9\ud574\ub3c4 \ubb34\ubc29\ud558\ub2e4. #include #include #include struct person{ char name[30]; char tel[14]; int hour; int payment; struct person *next; }; main() { FILE *data; struct person dummy; struct person *start=&dummy; struct person *wkdata; struct person [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-7857","post","type-post","status-publish","format-standard","hentry","category-12"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-22J","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/7857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7857"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/7857\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7857"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}