摘要:
思路是模拟从低位到高位的按位相加,需要考虑进位 public String addStrings(String num1, String num2) { int bitLen1 = num1.length() - 1, bitLen2 = num2.length() - 1; StringBuild 阅读全文
摘要:
public boolean checkPerfectNumber(int num) { int sum = 0; for (int i = 1; i <= num / 2; i++) if (num % i == 0) sum += i; return sum == num; } 阅读全文