官术网_书友最值得收藏!

10. Sums of multiples

Write a program that calculates the sums of multiples of 3 or 5 between zero and a given maximum value. For example, if the maximum is 30, then the program should calculate 3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 + 20 + 21 + 24 + 25 + 27 + 30 = 225 because those are the multiples of 3 and 5.

主站蜘蛛池模板: 屯门区| 崇左市| 呼和浩特市| 武冈市| 中江县| 张家港市| 福海县| 星子县| 翁源县| 昌吉市| 贵南县| 穆棱市| 永德县| 洞头县| 华亭县| 阳春市| 桑植县| 龙胜| 无锡市| 措美县| 乌海市| 襄樊市| 双桥区| 芷江| 新巴尔虎右旗| 喀喇| 东台市| 商水县| 沐川县| 西青区| 合山市| 五河县| 东山县| 德庆县| 吉木乃县| 新蔡县| 进贤县| 肇州县| 鄯善县| 沂南县| 岳阳县|