{"id":13195,"date":"2022-12-27T14:50:50","date_gmt":"2022-12-27T06:50:50","guid":{"rendered":"https:\/\/fgchen.com\/wpedu\/?p=13195"},"modified":"2026-03-30T14:32:02","modified_gmt":"2026-03-30T06:32:02","slug":"tqc-%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80python-508-%e6%9c%80%e5%a4%a7%e5%85%ac%e5%9b%a0%e6%95%b8","status":"publish","type":"post","link":"https:\/\/fgchen.com\/wpedu\/2022\/12\/tqc-%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80python-508-%e6%9c%80%e5%a4%a7%e5%85%ac%e5%9b%a0%e6%95%b8\/","title":{"rendered":"TQC+ \u7a0b\u5f0f\u8a9e\u8a00Python 508 \u6700\u5927\u516c\u56e0\u6578"},"content":{"rendered":"1. \u984c\u76ee\u8aaa\u660e:\r\n\u8acb\u958b\u555fPYD508.py\u6a94\u6848\uff0c\u4f9d\u4e0b\u5217\u984c\u610f\u9032\u884c\u4f5c\u7b54\uff0c\u8a08\u7b97\u5169\u500b\u6b63\u6574\u6578\u7684\u6700\u5927\u516c\u56e0\u6578\uff0c\u4f7f\u8f38\u51fa\u503c\u7b26\u5408\u984c\u610f\u8981\u6c42\u3002\u4f5c\u7b54\u5b8c\u6210\u8acb\u53e6\u5b58\u65b0\u6a94\u70baPYA508.py\u518d\u9032\u884c\u8a55\u5206\u3002\u3002\r\n\r\n2. \u8a2d\u8a08\u8aaa\u660e\uff1a\r\n\u8acb\u64b0\u5beb\u4e00\u7a0b\u5f0f\uff0c\u8b93\u4f7f\u7528\u8005\u8f38\u5165\u5169\u500b\u6b63\u6574\u6578x\u3001y\uff0c\u4e26\u5c07x\u8207y\u50b3\u905e\u7d66\u540d\u70bacompute()\u7684\u51fd\u5f0f\uff0c\u6b64\u51fd\u5f0f\u56de\u50b3x\u548cy\u7684\u6700\u5927\u516c\u56e0\u6578\u3002\r\n\r\n3. \u8f38\u5165\u8f38\u51fa\uff1a\r\n\u8f38\u5165\u8aaa\u660e\r\n\u5169\u500b\u6b63\u6574\u6578\uff08\u4ee5\u534a\u5f62\u9017\u865f\u5206\u9694\uff09\r\n\r\nx,y\r\n\r\n\u8f38\u51fa\u8aaa\u660e\r\n\u6700\u5927\u516c\u56e0\u6578\r\n\r\n\u7bc4\u4f8b\u8f38\u51651\r\n12,8\r\n\u7bc4\u4f8b\u8f38\u51fa1\r\n4\r\n\u7bc4\u4f8b\u8f38\u51652\r\n4,6\r\n\u7bc4\u4f8b\u8f38\u51fa2\r\n2\r\n\r\n&nbsp;\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def compute(a, b):\r\n    while b!= 0:\r\n        t = b\r\n        b = a % b\r\n        a = t\r\n    return a\r\n\r\na, b = eval(input())\r\n\r\nprint(compute(a, b))<\/pre>\r\n&nbsp;","protected":false},"excerpt":{"rendered":"<p>1. \u984c\u76ee\u8aaa\u660e: \u8acb\u958b\u555fPYD508.py\u6a94\u6848\uff0c\u4f9d\u4e0b\u5217\u984c\u610f\u9032\u884c\u4f5c\u7b54\uff0c\u8a08\u7b97\u5169\u500b\u6b63\u6574 &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[266],"tags":[],"class_list":["post-13195","post","type-post","status-publish","format-standard","hentry","category-266"],"_links":{"self":[{"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/posts\/13195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/comments?post=13195"}],"version-history":[{"count":3,"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/posts\/13195\/revisions"}],"predecessor-version":[{"id":13497,"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/posts\/13195\/revisions\/13497"}],"wp:attachment":[{"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/media?parent=13195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/categories?post=13195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fgchen.com\/wpedu\/wp-json\/wp\/v2\/tags?post=13195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}