{"id":288,"date":"2018-10-26T22:42:17","date_gmt":"2018-10-26T14:42:17","guid":{"rendered":"https:\/\/blog.tcreopargh.xyz\/?p=288"},"modified":"2018-12-14T16:53:10","modified_gmt":"2018-12-14T08:53:10","slug":"c-c%e5%ae%8c%e6%95%b0","status":"publish","type":"post","link":"https:\/\/blog.tcreopargh.xyz\/?p=288","title":{"rendered":"(C\/C++)\u5b8c\u6570"},"content":{"rendered":"\n<div class=\"mdui-panel mdui-panel-gapless\" mdui-panel>\n    <div class=\"mdui-panel-item mdui-panel-item-open\">\n      <div class=\"mdui-panel-item-header\">\n        <div class=\"mdui-panel-item-title\"><strong>\u95ee\u9898\u63cf\u8ff0<\/strong><\/div>\n        <i class=\"mdui-panel-item-arrow mdui-icon material-icons\">keyboard_arrow_down<\/i>\n      <\/div>\n      <div class=\"mdui-panel-item-body\">\n        <p>\u8bf7\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u7ed9\u51fa\u6307\u5b9a\u6574\u6570\u8303\u56f4[a\uff0cb]\u5185\u7684\u6240\u6709\u5b8c\u6570\uff0c0 &lt; a &lt; b &lt; 10000\u3002\u4e00\u4e2a\u6570\u5982\u679c\u6070\u597d\u7b49\u4e8e\u9664\u5b83\u672c\u8eab\u5916\u7684\u6240\u6709\u56e0\u5b50\u4e4b\u548c\uff0c\u8fd9\u4e2a\u6570\u5c31\u79f0\u4e3a&#8221;\u5b8c\u6570&#8221;\u3002\u4f8b\u59826\u662f\u5b8c\u6570\uff0c\u56e0\u4e3a6=1\uff0b2\uff0b3<\/p>\n      <\/div>\n    <\/div>\n  <\/div>\n\n\n\n<div class=\"mdui-panel mdui-panel-gapless\" mdui-panel>\n    <div class=\"mdui-panel-item mdui-panel-item-open\">\n      <div class=\"mdui-panel-item-header\">\n        <div class=\"mdui-panel-item-title\"><strong>\u8f93\u5165\u8bf4\u660e<\/strong><\/div>\n        <i class=\"mdui-panel-item-arrow mdui-icon material-icons\">keyboard_arrow_down<\/i>\n      <\/div>\n      <div class=\"mdui-panel-item-body\">\n        <p>\u53ea\u6709\u4e00\u7ec4\u6570\u636e\uff0c\u5373\u4e00\u884c\u4e0a\u7684\u4e24\u4e2a\u6574\u6570a\u548cb\uff0ca\u548cb\u4e4b\u95f4\u7528\u7a7a\u683c\u5206\u9694<\/p>\n      <\/div>\n    <\/div>\n  <\/div>\n\n\n\n<div class=\"mdui-panel mdui-panel-gapless\" mdui-panel>\n    <div class=\"mdui-panel-item mdui-panel-item-open\">\n      <div class=\"mdui-panel-item-header\">\n        <div class=\"mdui-panel-item-title\"><strong>\u8f93\u51fa\u8bf4\u660e<\/strong><\/div>\n        <i class=\"mdui-panel-item-arrow mdui-icon material-icons\">keyboard_arrow_down<\/i>\n      <\/div>\n      <div class=\"mdui-panel-item-body\">\n        <p>\u8f93\u51fa[a\uff0cb]\u5185\u7684\u6240\u6709\u5b8c\u6570\uff0c\u6bcf\u4e2a\u6570\u5b57\u5360\u4e00\u884c&nbsp;<\/p>\n      <\/div>\n    <\/div>\n  <\/div>\n\n\n\n<p><strong>\u8f93\u5165\u6837\u4f8b<\/strong><\/p>\n\n\n\n<p>1 10&nbsp;<br><strong>\u8f93\u51fa\u6837\u4f8b<\/strong><\/p>\n\n\n\n<p>6<\/p>\n\n\n\n<p>\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n\n<div class=\"codecolorer-container c default\" style=\"overflow:auto;white-space:nowrap;width:958px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/><\/div><\/td><td><div class=\"c codecolorer\"><span class=\"co1\">\/\/Powered by TCreopargh<\/span><br \/>\n<span class=\"co2\">#include&lt;stdio.h&gt;<\/span><br \/>\n<span class=\"kw4\">int<\/span> main<span class=\"br0\">&#40;<\/span><span class=\"kw4\">int<\/span> argc<span class=\"sy0\">,<\/span> <span class=\"kw4\">char<\/span> <span class=\"sy0\">*<\/span>argv<span class=\"br0\">&#91;<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw4\">int<\/span> a<span class=\"sy0\">,<\/span>b<span class=\"sy0\">,<\/span>i<span class=\"sy0\">,<\/span>sum<span class=\"sy0\">=<\/span><span class=\"nu0\">0<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <a href=\"http:\/\/www.opengroup.org\/onlinepubs\/009695399\/functions\/scanf.html\"><span class=\"kw3\">scanf<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;%d%d&quot;<\/span><span class=\"sy0\">,&amp;<\/span>a<span class=\"sy0\">,&amp;<\/span>b<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">for<\/span><span class=\"br0\">&#40;<\/span><span class=\"sy0\">;<\/span>a<span class=\"sy0\">&lt;<\/span>b<span class=\"sy0\">;<\/span>a<span class=\"sy0\">++<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; sum<span class=\"sy0\">=<\/span><span class=\"nu0\">0<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">for<\/span><span class=\"br0\">&#40;<\/span>i<span class=\"sy0\">=<\/span><span class=\"nu0\">1<\/span><span class=\"sy0\">;<\/span>i<span class=\"sy0\">&lt;<\/span>a<span class=\"sy0\">;<\/span>i<span class=\"sy0\">++<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span><span class=\"br0\">&#40;<\/span>a<span class=\"sy0\">%<\/span>i<span class=\"sy0\">==<\/span><span class=\"nu0\">0<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sum<span class=\"sy0\">+=<\/span>i<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span><span class=\"br0\">&#40;<\/span>sum<span class=\"sy0\">==<\/span>a<span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"http:\/\/www.opengroup.org\/onlinepubs\/009695399\/functions\/printf.html\"><span class=\"kw3\">printf<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;%d<span class=\"es1\">\\n<\/span>&quot;<\/span><span class=\"sy0\">,<\/span>a<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">return<\/span> <span class=\"nu0\">0<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>\u8f93\u5165\u6837\u4f8b 1 10&nbsp;\u8f93\u51fa\u6837\u4f8b 6 \u4ee3\u7801\u5982\u4e0b\uff1a 123456789101112131415161718 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,7,32,10],"tags":[37,16,40,39,38],"_links":{"self":[{"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/posts\/288"}],"collection":[{"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":12,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":422,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions\/422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tcreopargh.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}