- The Modern C# Challenge
- Rod Stephens
- 74字
- 2021-08-13 15:23:53
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.