@@ -0,0 +1,815 @@
+package answers;%0A%0A/**%0A * Created by seok on 2017. 2. 5..%0A *%0A * problem 1%0A * 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.%0A * Find the sum of all the multiples of 3 or 5 below 1000.%0A */%0Apublic class problem1 %7B%0A    public static void main(String%5B%5D args) %7B%0A        calc calc1 = new calc();%0A        int result = 0;%0A        result = calc1.sumMultiples(3, 1000 ) + calc1.sumMultiples(5, 1000 ) - calc1.sumMultiples(15, 1000);%0A        System.out.println(result);%0A    %7D%0A%7D%0A%0Aclass calc %7B%0A    public int sumMultiples(int multiple, int max) %7B%0A        int sum = 0;%0A        int current = multiple;%0A        while ( current %3C= max ) %7B%0A            sum = sum + current;%0A            current = current + multiple;%0A        %7D%0A        return sum;%0A    %7D%0A%7D

problem 1 answers