fork download
  1. import java.io.*;
  2. import java.math.BigInteger;
  3.  
  4. class Ideone
  5. {
  6. public static boolean divisivel(BigInteger numero, String divisor) {
  7. return numero.mod(new BigInteger(divisor)).equals(BigInteger.ZERO);
  8. }
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. System.out.println(divisivel(new BigInteger("495"), "495")); // true
  12. System.out.println(divisivel(new BigInteger("496"), "495")); // false
  13. }
  14. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
true
false