public static int euler(int x){ int sum = 0; if(x%3==0||x%5==0){ sum += x;} return sum ; }
def euler(num):sum = 0for x in range(num):if x%3==0 or x%5==0:sum += xreturn sum- public static int euler(int x){
- int sum = 0;
- if(x%3==0||x%5==0){
- sum += x;}
- return sum ;
- }
System.out.println(euler(23));
test.assert_equals(euler(10), 23)test.assert_equals(euler(1000), 233168)- System.out.println(euler(23));