1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/统计能整除数字的位数 [count-the-digits-that-divide-a-number].html
2023-01-04 16:53:10 +08:00

36 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数 <code>num</code> ,返回 <code>num</code> 中能整除 <code>num</code> 的数位的数目。</p>
<p>如果满足&nbsp;<code>nums % val == 0</code> ,则认为整数 <code>val</code> 可以整除 <code>nums</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>num = 7
<strong>输出:</strong>1
<strong>解释:</strong>7 被自己整除,因此答案是 1 。
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>num = 121
<strong>输出:</strong>2
<strong>解释:</strong>121 可以被 1 整除,但无法被 2 整除。由于 1 出现两次,所以返回 2 。
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>num = 1248
<strong>输出:</strong>4
<strong>解释:</strong>1248 可以被它每一位上的数字整除,因此答案是 4 。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= num &lt;= 10<sup>9</sup></code></li>
<li><code>num</code> 的数位中不含 <code>0</code></li>
</ul>