My code's assignment is to show if a number does divide with numbers 1-12 or not. If it does then it should print ("1"), if not ("0").
Example:
Input == 6;
Output == 111001000000;
The problem is that "%" does not work with BigInteger's. I have searched for a solution and found that BigInteger mod(BigInteger other) should do the the job, but i can not really catch it how could i use it, because every time and every way I try to use it. It throws an error.
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigInteger bi = sc.nextBigInteger();
for (int i = 1; i <= 12; i++) {
if (bi % i == 0) {
System.out.print("1");
}
if (bi % i != 0) {
System.out.print("0");
}
}
}
}