{"id":922,"date":"2012-06-24T12:31:15","date_gmt":"2012-06-24T04:31:15","guid":{"rendered":"http:\/\/www.hsyyf.me\/?p=922"},"modified":"2012-06-24T12:41:03","modified_gmt":"2012-06-24T04:41:03","slug":"project-euler-1","status":"publish","type":"post","link":"https:\/\/www.hsyyf.me\/?p=922","title":{"rendered":"Project Euler 1"},"content":{"rendered":"<div>\n<p>\u8c8c\u4f3c\u7b2c\u4e00\u9898\u662f\u6700\u7b80\u5355\u7684\u4e00\u9053\u9898\u2014\u2014<\/p>\n<p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.<\/p>\n<p>Find the sum of all the multiples of 3 or 5 below 1000.<\/p>\n<p>\u6c421000\u4ee5\u51853\u6216\u80055\u7684\u500d\u6570\u7684\u548c\uff0c\u6700\u7b80\u5355\u7684\u5b9e\u73b0\u662f\u4e00\u4e2afor\u5faa\u73af\uff0c\u751a\u81f3\u8fde\u4e00\u822c\u7684\u7b97\u6cd5\u90fd\u7528\u4e0d\u4e0a\uff0c\u60f3\u6765\u4e5f\u662f\u5f00\u5c71\u7b2c\u4e00\u9898\u7ed9\u7684\u7b80\u5355\u4e9b\u5427\u3002<br \/>\n\u4e0d\u8fc7\u8fd9\u6837\u76f4\u63a5\u8ba1\u7b97\u7684\u6548\u7387\u4e0d\u9ad8\uff0c\u5f53\u8303\u56f4\u53d6\u5f97\u5f88\u5927\u7684\u65f6\u5019\uff0c\u8ba1\u7b97\u7684\u65f6\u95f4\u5c06\u4f1a\u5f88\u957f\u3002\u4e3b\u8981\u662f\u5386\u904d\u6240\u6709\u53ef\u80fd\u7684\u53d6\u503c\u8017\u65f6\u7e41\u7410\uff0c\u5bf9\u4e8e\u4e00\u822c\u7684\u89e3\u6cd5\uff0c\u591a\u6570\u662f\u5206\u522b\u53d63\u548c5\u4e3a\u6b65\u957f\uff0c\u6c42\u548c\uff0c\u7136\u540e\u518d\u9664\u53bb15\u7684\u500d\u6570\u3002\u8fd9\u6837\u6548\u7387\u7565\u5fae\u9ad8\u4e00\u4e9b\uff0c\u8017\u65f6\u4e5f\u662f\u539f\u6765\u76840.6\u500d\u3002<\/p>\n<p>C\u8bed\u8a00\u5b9e\u73b0\uff1a<\/p>\n<p><code lang=\"c\">\/*========================================================================<br \/>\n#   FileName: Main.c<br \/>\n#     Author: hsyyf<br \/>\n#      Email: 931107419@qq.com<br \/>\n#   HomePage: http:\/\/www.hsyyf.me<br \/>\n# LastChange: 2012-06-24 12:30:12<br \/>\n========================================================================*\/<br \/>\n#include<stdio.h><br \/>\nint main(void)<br \/>\n{<br \/>\n\tint i,sum;<br \/>\n\tsum=0;<br \/>\n\tfor(i=1;i<1000;i++)\n\t{\n\t\tif(i%3==0 || i%5==0)\n\t\t\tsum=sum+i;\n\t}\n\tprintf(\"%d\",sum);\n\treturn 0;\n}<\/code><\/p>\n<p>\u7ed3\u679c\u662f233168.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8c8c\u4f3c\u7b2c\u4e00\u9898\u662f\u6700\u7b80\u5355\u7684\u4e00\u9053\u9898\u2014\u2014 If we list all the natural numbers belo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[16],"tags":[127],"class_list":["post-922","post","type-post","status-publish","format-standard","hentry","category-16","tag-project-euler"],"_links":{"self":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts\/922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=922"}],"version-history":[{"count":0,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}