{"id":2254,"date":"2019-03-19T02:31:49","date_gmt":"2019-03-19T02:31:49","guid":{"rendered":""},"modified":"2019-03-19T10:32:04","modified_gmt":"2019-03-19T02:32:04","slug":"c51%e5%8d%95%e7%89%87%e6%9c%ba%e4%b8%ad%e6%96%ad%e5%87%bd%e6%95%b0%e7%9a%84%e4%bf%ae%e9%a5%b0%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2254","title":{"rendered":"C51\u5355\u7247\u673a\u4e2d\u65ad\u51fd\u6570\u7684\u4fee\u9970\u65b9\u6cd5"},"content":{"rendered":"
\n\tinte<\/u>rruptm\u4fee\u9970\u7b26<\/p>\n
\n\tC51\u4e2d\u65ad\u51fd\u6570\u5fc5\u987b\u901a\u8fc7\u8be5\u4fee\u9970\u7b26\u8fdb\u884c\u4fee\u9970\u3002\u5728C51\u7a0b\u5e8f\u8bbe\u8ba1\u4e2d\uff0c\u5f53\u51fd\u6570\u5b9a\u4e49\u65f6\u7528\u4e86interruptm\u4fee\u9970\u7b26\uff0c\u7cfb\u7edf\u7f16\u8bd1\u65f6\u628a\u5bf9\u5e94\u51fd\u6570\u8f6c\u5316\u4e3a\u4e2d\u65ad\u51fd\u6570\uff0c\u81ea\u52a8\u52a0\u4e0a\u7a0b\u5e8f\u5934\u6bb5\u548c\u5c3e\u6bb5\uff0c\u5e76\u630951\u7cfb\u7edf\u4e2d\u65ad\u7684\u5904\u7406\u65b9\u5f0f\u81ea\u52a8\u628a\u5b83\u5b89\u6392\u5728\u7a0b\u5e8f\u5b58\u50a8\u5668\u4e2d\u7684\u76f8\u5e94\u4f4d\u7f6e\u3002<\/p>\n
\n\t\u5728\u8be5\u4fee\u9970\u7b26\u4e2d\uff0cm\u7684\u53d6\u503c\u4e3a0~31\uff0c\u5bf9\u5e94\u7684\u4e2d\u65ad\u60c5\u51b5\u5982\u4e0b\uff1a<\/p>\n
\n\t0——\u5916\u90e8\u4e2d\u65ad0<\/p>\n
\n\t1——\u5b9a\u65f6\/\u8ba1\u6570\u5668T0<\/p>\n
\n\t2——\u5916\u90e8\u4e2d\u65ad1<\/p>\n
\n\t3——\u5b9a\u65f6\/\u8ba1\u6570\u5668T1<\/p>\n
\n\t4——\u4e32\u884c\u53e3\u4e2d\u65ad<\/p>\n
\n\t5——\u5b9a\u65f6\/\u8ba1\u6570\u5668T2<\/p>\n
\n\t\u5176\u5b83\u503c\u9884\u7559\u3002<\/p>\n
\n\t
\n\t <\/p>\n
\n\tC51\u7f16\u8bd1\u5668\u4ece\u7edd\u5bf9\u5730\u57408m+3\u5904\u4ea7\u751f\u4e00\u4e2a\u4e2d\u65ad\u5411\u91cf\uff0c\u5176\u4e2dm\u4e3a\u4e2d\u65ad\u53f7\uff0c\u4e5f\u5373interrupt\u540e\u9762\u7684\u6570\u5b57\u3002\u8be5\u5411\u91cf\u5305\u542b\u4e00\u4e2a\u5230\u4e2d\u65ad\u51fd\u6570\u5165\u53e3\u5730\u5740\u7684\u7edd\u5bf9\u8df3\u8f6c\u3002<\/p>\n
\n\t\u3010\u4f8b\u3011\u7f16\u5199\u4e00\u4e2a\u7528\u4e8e\u7edf\u8ba1\u5916\u4e2d\u65ad0\u7684\u4e2d\u65ad\u6b21\u6570\u7684\u4e2d\u65ad\u670d\u52a1\u7a0b\u5e8f<\/p>\n
\n\t1intx=0;2voidint0\uff08\uff09interrupt0using13{4x++;5}<\/p>\n
\n\tusingn\u4fee\u9970\u7b26<\/p>\n
\n\t\u4fee\u9970\u7b26usingn\u7528\u4e8e\u6307\u5b9a\u672c\u51fd\u6570\u5185\u90e8\u4f7f\u7528\u7684\u5de5\u4f5c\u5bc4\u5b58\u5668<\/u>\u7ec4\uff0c\u5176\u4e2dn\u7684\u53d6\u503c\u4e3a0~3\uff0c\u8868\u793a\u5bc4\u5b58\u5668\u7ec4\u53f7\u3002\u8be5\u4fee\u9970\u7b26\u53ef\u4ee5\u7701\u7565\uff0c\u7701\u7565\u540e\u7cfb\u7edf\u81ea\u52a8\u9009\u62e9<\/p>\n
\n\t\u4e2d\u65ad\u51fd\u6570\u6ce8\u610f\u5982\u4e0b\uff1a<\/p>\n
\n\t\uff081\uff09\u4e2d\u65ad\u51fd\u6570\u4e0d\u80fd\u8fdb\u884c\u53c2\u6570\u4f20\u9012\uff0c\u5982\u679c\u4e2d\u65ad\u51fd\u6570\u4e2d\u5305\u542b\u4efb\u4f55\u53c2\u6570\u58f0\u660e\u90fd\u5c06\u5bfc\u81f4\u7f16\u8bd1\u51fa\u9519\u3002<\/p>\n
\n\t\uff082\uff09\u4e2d\u65ad\u51fd\u6570\u6ca1\u6709\u8fd4\u56de\u503c\uff0c\u5982\u679c\u4f01\u56fe\u5b9a\u4e49\u4e00\u4e2a\u8fd4\u56de\u503c\u5c06\u5f97\u4e0d\u5230\u6b63\u786e\u7684\u7ed3\u679c\uff0c\u5efa\u8bae\u5728\u5b9a\u4e49\u4e2d\u65ad\u51fd\u6570\u65f6\u5c06\u5176\u5b9a\u4e49\u4e3avoid\u7c7b\u578b\uff0c\u4ee5\u660e\u786e\u8bf4\u660e\u6ca1\u6709\u8fd4\u56de\u503c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
in te rruptm\u4fee\u9970\u7b26 C51\u4e2d\u65ad\u51fd\u6570\u5fc5\u987b\u901a\u8fc7\u8be5\u4fee\u9970\u7b26\u8fdb\u884c\u4fee\u9970\u3002\u5728C51\u7a0b\u5e8f\u8bbe\u8ba1\u4e2d\uff0c\u5f53\u51fd\u6570\u5b9a\u4e49\u65f6\u7528\u4e86interruptm\u4fee\u9970\u7b26\uff0c\u7cfb\u7edf\u7f16\u8bd1\u65f6\u628a\u5bf9\u5e94\u51fd\u6570\u8f6c\u5316\u4e3a\u4e2d\u65ad\u51fd\u6570\uff0c\u81ea\u52a8\u52a0\u4e0a\u7a0b\u5e8f\u5934\u6bb5\u548c\u5c3e\u6bb5\uff0c\u5e76\u6309<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2254"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2254"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2254\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2254"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}