Numbers divisible by six

Report a typo

Find the sum of numbers divisible by 6 in the given sequence of natural numbers.

The first line of the input is the number of elements in the sequence; the next lines are the elements themselves.

It is guaranteed that there is always a number divisible by 6 in the sequence.

Sample Input 1:

12
39
36
21
57
12
19
6
52
73
49
44
47

Sample Output 1:

54
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// start coding here
}
}
___

Create a free account to access the full topic