mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			952 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			952 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给你一个由正整数组成的整数数组 <code>nums</code> ,返回其中可被 <code>3</code> 整除的所有偶数的平均值。</p>
 | 
						||
 | 
						||
<p>注意:<code>n</code> 个元素的平均值等于 <code>n</code> 个元素 <strong>求和</strong> 再除以 <code>n</code> ,结果 <strong>向下取整</strong> 到最接近的整数。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>nums = [1,3,6,10,12,15]
 | 
						||
<strong>输出:</strong>9
 | 
						||
<strong>解释:</strong>6 和 12 是可以被 3 整除的偶数。(6 + 12) / 2 = 9 。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>nums = [1,2,4,7,10]
 | 
						||
<strong>输出:</strong>0
 | 
						||
<strong>解释:</strong>不存在满足题目要求的整数,所以返回 0 。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= nums.length <= 1000</code></li>
 | 
						||
	<li><code>1 <= nums[i] <= 1000</code></li>
 | 
						||
</ul>
 |