📜  isSelfDivisor java 代码示例

📅  最后修改于: 2022-03-11 14:52:31.198000             🧑  作者: Mango

代码示例1
a.
public static boolean isSelfDivisor(int number)
  {
    String s = String.valueOf(number);
    for (int i = 0; i < s.length(); i++)
    {
      int d = Integer.parseInt(s.substring(i, i+1));
      if (d == 0 || number % d != 0)
        return false;
    }
    return true;
  }