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)/公因子的数目 [number-of-common-factors].html
2022-10-07 21:03:28 +08:00

27 lines
858 B
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>a</code><code>b</code> ,返回 <code>a</code><code>b</code><strong></strong> 因子的数目。</p>
<p>如果 <code>x</code> 可以同时整除 <code>a</code><code>b</code> ,则认为 <code>x</code><code>a</code><code>b</code> 的一个 <strong>公因子</strong></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>a = 12, b = 6
<strong>输出:</strong>4
<strong>解释:</strong>12 和 6 的公因子是 1、2、3、6 。
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>a = 25, b = 30
<strong>输出:</strong>2
<strong>解释:</strong>25 和 30 的公因子是 1、5 。</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= a, b &lt;= 1000</code></li>
</ul>