mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			816 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			816 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>对于一个 <strong>正整数</strong>,如果它和除了它自身以外的所有 <strong>正因子</strong> 之和相等,我们称它为 <strong>「完美数」</strong>。</p>
 | 
						||
 | 
						||
<p>给定一个 <strong>整数 </strong><code>n</code>, 如果是完美数,返回 <code>true</code>;否则返回 <code>false</code>。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>num = 28
 | 
						||
<strong>输出:</strong>true
 | 
						||
<strong>解释:</strong>28 = 1 + 2 + 4 + 7 + 14
 | 
						||
1, 2, 4, 7, 和 14 是 28 的所有正因子。</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>num = 7
 | 
						||
<strong>输出:</strong>false
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= num <= 10<sup>8</sup></code></li>
 | 
						||
</ul>
 |