mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 05:13:29 +08:00
更新国内版力扣题目描述变更
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
<p>Write methods to implement the multiply, subtract, and divide operations for integers. The results of all of these are integers. Use only the add operator.</p>
|
||||
|
||||
<p>You should implement following methods:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>Operations()</code> constructor</li>
|
||||
<li><code>minus(a, b)</code> Subtraction, returns <code>a - b</code></li>
|
||||
<li><code>multiply(a, b)</code> Multiplication, returns <code>a * b</code></li>
|
||||
<li><code>divide(a, b)</code> Division, returns <code>a / b</code></li>
|
||||
</ul>
|
||||
|
||||
<p><strong>Example: </strong></p>
|
||||
|
||||
<pre>
|
||||
Operations operations = new Operations();
|
||||
operations.minus(1, 2); //returns -1
|
||||
operations.multiply(3, 4); //returns 12
|
||||
operations.divide(5, -2); //returns -2
|
||||
</pre>
|
||||
|
||||
<p><strong>Note: </strong></p>
|
||||
|
||||
<ul>
|
||||
<li>You can assume inputs are always valid, that is, e.g., denominator will not be 0 in division.</li>
|
||||
<li>The number of calls will not exceed 1000.</li>
|
||||
</ul>
|
||||
<p>Write methods to implement the multiply, subtract, and divide operations for integers. The results of all of these are integers. Use only the add operator.</p>
|
||||
|
||||
|
||||
|
||||
<p>You should implement following methods:</p>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li><code>Operations()</code> constructor</li>
|
||||
|
||||
<li><code>minus(a, b)</code> Subtraction, returns <code>a - b</code></li>
|
||||
|
||||
<li><code>multiply(a, b)</code> Multiplication, returns <code>a * b</code></li>
|
||||
|
||||
<li><code>divide(a, b)</code> Division, returns <code>a / b</code></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<p><strong>Example: </strong></p>
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user