mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part2
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<p>给你一个正整数 <code>num</code> ,请你统计并返回 <strong>小于或等于</strong> <code>num</code> 且各位数字之和为 <strong>偶数</strong> 的正整数的数目。</p>
|
||||
|
||||
<p>正整数的 <strong>各位数字之和</strong> 是其所有位上的对应数字相加的结果。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>num = 4
|
||||
<strong>输出:</strong>2
|
||||
<strong>解释:</strong>
|
||||
只有 2 和 4 满足小于等于 4 且各位数字之和为偶数。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>num = 30
|
||||
<strong>输出:</strong>14
|
||||
<strong>解释:</strong>
|
||||
只有 14 个整数满足小于等于 30 且各位数字之和为偶数,分别是:
|
||||
2、4、6、8、11、13、15、17、19、20、22、24、26 和 28 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= num <= 1000</code></li>
|
||||
</ul>
|
Reference in New Issue
Block a user