跨年简单题来咯
由于目前奇完全数还未被发现,因此题目范围 [1,10^8]内的奇数:6, 28, 496, 8128, 33550336
java:
class Solution {
public boolean checkPerfectNumber(int num) {
return num == 6 || num ==28 || num == 496 || num == 8128 || num == 33550336;
}
}
python:
class Solution:
def checkPerfectNumber(self, num: int) -> bool:
return num == 6 or num ==28 or num == 496 or num == 8128 or num == 33550336