{"id":308,"date":"2020-03-22T08:55:34","date_gmt":"2020-03-22T00:55:34","guid":{"rendered":"https:\/\/jingran.vip\/?p=308"},"modified":"2020-06-22T04:02:57","modified_gmt":"2020-06-21T20:02:57","slug":"%e5%bc%80%e8%af%be%e5%90%a7-python%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e5%8d%81%e4%b8%80%ef%bc%89","status":"publish","type":"post","link":"https:\/\/jingran.vip\/index.php\/2020\/03\/22\/%e5%bc%80%e8%af%be%e5%90%a7-python%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e5%8d%81%e4%b8%80%ef%bc%89\/","title":{"rendered":"\u5f00\u8bfe\u5427-Python\u5b66\u4e60\u7b14\u8bb0\uff08\u5341\u4e00\uff09"},"content":{"rendered":"\n<p class=\"has-huge-font-size\"><strong>\u7b2c\u4e8c\u7ae0<\/strong>\u00a0<strong>\u7b2c8\u8282 \u95ea\u7535\u5feb\u9012<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1101.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-large-font-size\"> <strong>\u660e\u786e\u9879\u76ee\u76ee\u7684 <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/python-xiaoke\/enter_1103.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u5206\u6790\u6d41\u7a0b\uff0c\u62c6\u89e3\u9879\u76ee <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/python-xiaoke\/enter_1105.001.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code># \u914d\u9001\u6b21\u6570\u8ba1\u7b97\u516c\u5f0f\nsize = 2\nperson = 2\nnum = size * 100 \/ 20\/person\n\n# \u914d\u9001\u5458\u6570\u8ba1\u7b97\u516c\u5f0f\nsize = 0.6\nnum = 1\nperson = size *100 \/20\/ num<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1106.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"> <strong>3.1 \u9010\u6b65\u6267\u884c\uff0c\u4ee3\u7801\u5b9e\u73b0<\/strong> <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1107.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code># \u914d\u9001\u6b21\u6570\u8ba1\u7b97\ndef calculate_num(size,person):\n    #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n    \u2026\u2026\n\n# \u914d\u9001\u5458\u6570\u8ba1\u7b97\ndef calculate_person(size,num):\n    #\u914d\u9001\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n    \u2026\u2026\n\ncalculate_num(\u53c2\u65701,\u53c2\u65702)\ncalculate_person(\u53c2\u65701,\u53c2\u65702)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># \u914d\u9001\u6b21\u6570\u8ba1\u7b97\ndef calculate_num(size,person):\n    #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n    num = size * 100 \/ 20\/person\n    print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21\uff1a' %(size,person,num))\n# \u5feb\u9012\u5458\u6570\u8ba1\u7b97\ndef calculate_person(size,num):\n    #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n    person = size *100 \/20\/ num\n    print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(size,num,person))\n\ncalculate_num(2,2)\ncalculate_person(0.6,1)<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong> 3.2 \u518d\u6539\u8fdb <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1108.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u65e0\u8bba\u5c0f\u6570\u70b9\u4e4b\u540e\u662f\u70b9\u51e0\uff0c\u90fd\u8981\u5411\u4e0a\u8fdb\u4e00\u53d6\u6574\u6570\u3002\u4e5f\u5c31\u662f1.5\u8f6c\u62102\uff0c1.9\u8f6c\u62102\uff0c1.1\u8f6c\u62102\uff0c\u5373\u5bf9\u4eba\u6570\u9700\u8981\u5411\u4e0a\u53d6\u6574\u3002 <\/p>\n\n\n\n<p><strong>\u53d1\u73b0\uff1a<\/strong>\u5411\u4e0a\u53d6\u6574\u662fmath.ceil(), \u62ec\u53f7\u5185\u653e\u6570\u5b57\u3002 <\/p>\n\n\n\n<p>\u4e5f\u5c31\u662f\u4f7f\u7528math.ceil()\u65b9\u6cd5\uff0c\u5c31\u80fd\u628a\u6570\u5b57\u5411\u4e0a\u53d6\u6574\u3002\u5e76\u4e14\u5728\u5f00\u59cb\u4f4d\u7f6e\uff0c\u6709\u4e00\u53e5import math\uff0c \u600e\u4e48\u6709\u4e9b\u4f3c\u66fe\u76f8\u8bc6. \u5728\u4e0a\u4e2a\u9879\u76ee\u5b9e\u6218\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u968f\u673a\u6570\uff0c\u4e5f\u7528\u8fc7import math\u4ee3\u7801\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n# \u914d\u9001\u6b21\u6570\u8ba1\u7b97\ndef calculate_num(size,person):\n    #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n    num = math.ceil(size * 100 \/ 20\/person) \n    print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21\uff1a' %(size,person,num))\n# \u5feb\u9012\u5458\u6570\u8ba1\u7b97\ndef calculate_person(size,num):\n    #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n    person = math.ceil(size *100 \/20\/ num)\n    print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(size,num,person))\n\ncalculate_num(1.5,2)\ncalculate_person(0.5,1)<\/code><\/pre>\n\n\n\n<p>BOSS\u670b\u53cb\u9700\u8981\u4f7f\u7528\u4e24\u4e2a\u51fd\u6570\u624d\u80fd\u8ba1\u7b97\u914d\u9001\u6b21\u6570\uff0c\u8ba1\u7b97\u914d\u9001\u5458\u6570\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u80fd\u591f\u8ba9\u5979\u4f7f\u7528\u4e00\u4e2a\u51fd\u6570\u5c31\u80fd\u5b8c\u6210\u529f\u80fd\u3002 <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1112.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5de5\u4f5c\u91cf\u8ba1\u7b97\u51fd\u6570\ndef calculate_job(\u53c2\u6570\u2026\u2026):\n    \u2026\u2026\n\n# \u8c03\u7528\u5de5\u4f5c\u91cf\u8ba1\u7b97\u51fd\u6570\ncalculate_job(\u53c2\u6570\u2026\u2026)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5de5\u4f5c\u91cf\u8ba1\u7b97\u51fd\u6570\ndef calculate_job(\u53c2\u6570\u2026\u2026):\n    if \u6761\u4ef61\uff1a\n        ......#\u8ba1\u7b97\u914d\u9001\u5458\u6570\n    elif \u6761\u4ef62\uff1a\n        ......#\u8ba1\u7b97\u914d\u9001\u6b21\u6570\n\n# \u8c03\u7528\u5de5\u4f5c\u91cf\u8ba1\u7b97\u51fd\u6570\ncalculate_job(\u53c2\u6570\u2026\u2026)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n# \u914d\u9001\u8c03\u914d\u8ba1\u7b97\n# \u8bbe\u7f6e\u9ed8\u8ba4\u53c2\u6570\ndef calculate_job(size=1,person=None,num=None):\n    if(person !=None)and(num==None):\n         #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        num = math.ceil(size * 100 \/ 20\/person) \n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21' %(size,person,num))\n    elif(person==None)and(num!=None):\n        #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        person = math.ceil(size *100 \/20\/ num)\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(size,num,person))\ncalculate_job(size=1.5,person=2)\ncalculate_job(size=0.5,num=1)<\/code><\/pre>\n\n\n\n<p>\u4f46\u662f\uff0c\u6211\u4eec\u5728\u8c03\u7528\u51fd\u6570\u7684\u65f6\u5019\uff0c\u4f60\u8fd8\u8981\u8f93\u5165\u53c2\u6570\u540d\u4e0e\u53c2\u6570\u503c\uff0c\u592a\u9ebb\u70e6\uff0c\u6211\u4eec\u80fd\u4e0d\u80fd\u6709\u4e2a\u7b80\u5355\u65b9\u6cd5\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n# \u914d\u9001\u8c03\u914d\u8ba1\u7b97\n# \u8bbe\u7f6e\u9ed8\u8ba4\u53c2\u6570\ndef calculate_job(types,size,other):\n    if types ==1:\n        #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        num = math.ceil(size * 100 \/ 20\/other) \n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21' %(size,other,num))\n    elif types==2:\n        #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        person = math.ceil(size *100 \/20\/ other)\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(size,other,person))\ncalculate_job(1,1.5,2)\ncalculate_job(2,0.5,1)<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>3.3 \u7cbe\u7ec6\u5316 <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1113.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>BOSS\u670b\u53cb\u4e0d\u60f3\u6bcf\u6b21\u90fd\u53bb\u8c03\u7528\u51fd\u6570\uff0c\u624d\u80fd\u8ba1\u7b97\u7ed3\u679c\uff0c\u90a3\u5c31\u7ed9\u5979\u6574\u4e2a\u4ea4\u4e92\u8fc7\u7a0b\u3002 <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1115.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\ntypes = int(input('\u8bf7\u9009\u62e9\u9700\u8981\u8ba1\u7b97\u7684\u5de5\u4f5c\uff1a1-\u914d\u9001\u6b21\u6570\u8ba1\u7b97\uff0c2-\u5feb\u9012\u5458\u6570\u8ba1\u7b97\uff0c\u8bf7\u9009\u62e9\uff1a')) \nsizes = float(input('\u8bf7\u8f93\u5165\u9879\u76ee\u5927\u5c0f\uff1a1\u4ee3\u8868\u6807\u51c6\uff0c\u8fd8\u53ef\u4ee5\u8f93\u5165\u5176\u4ed6\u500d\u6570\u6216\u5c0f\u6570'))\nif types ==1:\n    others = int(input('\u8bf7\u8f93\u5165\u6295\u5165\u7684\u5feb\u9012\u5458\u6570\uff0c\u8bf7\u8f93\u5165\u6574\u6570'))\nelse:\n    others = int(input('\u8bf7\u8f93\u5165\u5feb\u9012\u6b21\u6570\uff0c\u8bf7\u8f93\u5165\u6574\u6570'))\n\n# \u914d\u9001\u8c03\u914d\u8ba1\u7b97\n# \u8bbe\u7f6e\u9ed8\u8ba4\u53c2\u6570\ndef calculate_job(types,sizes,others):\n    print('\u8ba1\u7b97\u7ed3\u679c\u5982\u4e0b')\n    if types ==1:\n         #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        num = math.ceil(sizes * 100 \/ 20\/others)\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21' %(sizes,others,num))\n    elif types==2:\n        #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        person = math.ceil(sizes *100 \/20\/ others)\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(sizes,others,person))\n\ncalculate_job(types,sizes,others)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1116.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5f53\u6211\u4eec\u9009\u62e9\u8ba1\u7b97\u914d\u9001\u6b21\u6570\uff0c \u9879\u76ee\u5927\u5c0f\u4e3a2.2\u500d\uff0c\u5feb\u9012\u5458\u6570\u4e3a1\u65f6\u3002 \u8ba1\u7b97\u5de5\u65f6\uff1a\u9700\u8981\u914d\u9001\u6b21\u6570 = 2.2*100\/20\/1 \uff0c\u5f97\u5230\u7684\u7ed3\u679c\u5e94\u8be5\u662f11\u6b21\uff0c\u53ef\u662f\u6253\u5370\u51fa\u6765\u5374\u662f12\u6b21\u3002 <\/p>\n\n\n\n<p>python\u6c5f\u6e56\u4e2d\u7684\u9664\u6cd5\uff0c\u4f1a\u5c06\u6570\u5b57\u90fd\u8f6c\u6362\u4e8c\u8fdb\u5236\u518d\u8fdb\u884c\u8ba1\u7b97\uff0c\u5f97\u5230\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u4e8c\u8fdb\u5236\uff0c\u9020\u6210\u6570\u5b57\u589e\u52a0\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\nprint(2.2*100\/20)\nprint(math.ceil(2.2*100\/20))<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\nprint(round(2.2*100\/20,2))<\/code><\/pre>\n\n\n\n<p>round()\u51fd\u6570\u662fpython\u4e2d\u63d0\u4f9b\u89e3\u51b3\u5c0f\u6570\u7684\u4fdd\u7559\u95ee\u9898\u3002\u6b64\u51fd\u6570\u683c\u5f0fround(x \uff0cn) x\u8868\u793a\u5c0f\u6570\uff0cn\u8868\u793a\u9700\u8981\u4fdd\u7559\u7684\u5c0f\u6570\u4f4d\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\ntypes = int(input('\u8bf7\u9009\u62e9\u9700\u8981\u8ba1\u7b97\u7684\u5de5\u4f5c\uff1a1-\u914d\u9001\u6b21\u6570\u8ba1\u7b97\uff0c2-\u5feb\u9012\u5458\u6570\u8ba1\u7b97\uff0c\u8bf7\u9009\u62e9')) \nsizes = float(input('\u8bf7\u8f93\u5165\u9879\u76ee\u5927\u5c0f\uff1a1\u4ee3\u8868\u6807\u51c6\uff0c\u8fd8\u53ef\u4ee5\u8f93\u5165\u5176\u4ed6\u500d\u6570\u6216\u5c0f\u6570'))\nif types ==1:\n    others = int(input('\u8bf7\u8f93\u5165\u6295\u5165\u7684\u5feb\u9012\u5458\u6570\uff0c\u8bf7\u8f93\u5165\u6574\u6570'))\nelse:\n    others = int(input('\u8bf7\u8f93\u5165\u5feb\u9012\u6b21\u6570\uff0c\u8bf7\u8f93\u5165\u6574\u6570'))\n\n# \u914d\u9001\u8c03\u914d\u8ba1\u7b97\n# \u8bbe\u7f6e\u9ed8\u8ba4\u53c2\u6570\ndef calculate_job(types,sizes,others):\n    print('\u8ba1\u7b97\u7ed3\u679c\u5982\u4e0b')\n    if types ==1:\n         #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        num = math.ceil(round((sizes * 100 \/ 20\/others),2))\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21' %(sizes,others,num))\n    elif types==2:\n        #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        person = math.ceil(round((sizes *100 \/20\/ others),2))\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(sizes,others,person))\n\ncalculate_job(types,sizes,others)<\/code><\/pre>\n\n\n\n<p>\u6309\u7167\u51fd\u6570\u5c01\u88c5\u4ee3\u7801\u7684\u601d\u60f3\uff0c\u6211\u4eec\u73b0\u5728\u4ee3\u7801\u5199\u7684\u5f88\u6742\u3002 <\/p>\n\n\n\n<p><strong>\u6c5f\u6e56\u7bb4\u8a00\uff1a<\/strong>\u521b\u5efa\u4e00\u4e2a\u4e3b\u51fd\u6570\uff0c\u7528\u6765\u8c03\u7528\u5176\u4ed6\u5b50\u51fd\u6570\u3002 <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/xiaoke-asset-prod.kaikeba.com\/smallcourse\/33de343e-a748-440f-b853-0ef2bd4e0d1d\/enter\/enter_1117.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n\ndef BOSS_input():\n    # \u8f93\u5165\u5185\u5bb9\n    types = int(input('\u8bf7\u9009\u62e9\u9700\u8981\u8ba1\u7b97\u7684\u5de5\u4f5c\uff1a1-\u914d\u9001\u6b21\u6570\u8ba1\u7b97\uff0c2-\u5feb\u9012\u5458\u6570\u8ba1\u7b97\uff0c\u8bf7\u9009\u62e9')) \n    sizes = float(input('\u8bf7\u8f93\u5165\u9879\u76ee\u5927\u5c0f\uff1a1\u4ee3\u8868\u6807\u51c6\uff0c\u8fd8\u53ef\u4ee5\u8f93\u5165\u5176\u4ed6\u500d\u6570\u6216\u5c0f\u6570'))\n    if types ==1:\n        others = int(input('\u8bf7\u8f93\u5165\u6295\u5165\u7684\u5feb\u9012\u5458\u6570\uff0c\u8bf7\u8f93\u5165\u6574\u6570'))\n    else:\n        others = int(input('\u8bf7\u8f93\u5165\u5feb\u9012\u6b21\u6570\uff0c\u8bf7\u8f93\u5165\u6574\u6570'))\n    \n    return types,sizes,others  #\u8fd9\u91cc\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4\n\n#\u8ba1\u7b97\u5de5\u4f5c\u91cf\ndef calculate_job(data_input):\n    #\u83b7\u53d6\u53c2\u6570\u6570\u503c\n    types = data_input&#91;0]\n    sizes = data_input&#91;1]\n    others = data_input&#91;2]\n\n    print('\u8ba1\u7b97\u7ed3\u679c\u5982\u4e0b')\n    if types ==1:\n         #\u914d\u9001\u6b21\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        num = math.ceil(round((sizes * 100 \/ 20\/others),2))\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c\u4f7f\u7528%d\u4f4d\u5feb\u9012\u5458\u914d\u9001\uff0c\u5219\u9700\u8981\u914d\u9001\u6b21\u6570%d\u6b21' %(sizes,others,num))\n    elif types==2:\n        #\u5feb\u9012\u5458\u6570\u8ba1\u7b97\u8fc7\u7a0b\n        person = math.ceil(round((sizes *100 \/20\/ others),2))\n        print('%.1f\u4e2a\u6807\u51c6\u96c6\u88c5\u7bb1\u5927\u7684\u5feb\u9012\u9879\u76ee\uff0c%d\u6b21\u914d\u9001\u5b8c\u6bd5\uff0c\u5219\u9700\u8981\u5feb\u9012\u5458\u6570\uff1a%d\u4f4d' %(sizes,others,person))\n\n\n#\u4e3b\u51fd\u6570\ndef res():\n    data_input = BOSS_input()\n    calculate_job(data_input)\n    \n#\u8c03\u7528\u4e3b\u51fd\u6570\nres()<\/code><\/pre>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u8bfe\u540e\u7ec3\u4e60<\/strong> <\/p>\n\n\n\n<p>1. \u901a\u8fc7\u81ea\u5df1\u65b9\u6cd5\uff0c\u5b8c\u6210\u5411\u4e0a\u53d6\u6574. \u7528\u6237\u8f93\u51651.1\uff0c\u53d8\u62102 \u7528\u6237\u8f93\u51651.5\uff0c\u53d8\u62102 \u7528\u6237\u8f93\u51651.9\uff0c\u53d8\u62102 <\/p>\n\n\n\n<p>2. \u51fa\u79df\u8f66\u8f66\u8d39\u8ba1\u7b97\u65b9\u5f0f\u5982\u4e0b\uff1a1\u3001\u6253\u8f66\u8ddd\u79bb\u57283\u516c\u91cc\u4ee5\u5185\uff0c\u53ea\u6536\u8d77\u6b65\u4ef715\u5143\u30022\u3001\u8ddd\u79bb\u57283\u516c\u91cc~15\u516c\u91cc\uff0c\u6bcf1\u516c\u91cc\u52a03\u5143\u30023\u3001\u8ddd\u79bb\u8d85\u8fc715\u516c\u91cc\u540e\uff0c\u6bcf1\u516c\u91cc\u52a05\u5143\u3002\u8bf7\u5b8c\u6210\u8ba1\u4ef7\u51fd\u6570\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e8c\u7ae0\u00a0\u7b2c8\u8282 \u95ea\u7535\u5feb\u9012 \u660e\u786e\u9879\u76ee\u76ee\u7684 \u5206\u6790\u6d41\u7a0b\uff0c\u62c6\u89e3\u9879\u76ee 3.1 \u9010\u6b65\u6267\u884c\uff0c\u4ee3\u7801\u5b9e\u73b0 3.2 \u518d\u6539 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,19,10],"tags":[],"_links":{"self":[{"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/posts\/308"}],"collection":[{"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":1,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions\/309"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/media\/190"}],"wp:attachment":[{"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jingran.vip\/index.php\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}