1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +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>&nbsp; constructor</li>
<li><code>minus(a, b)</code>&nbsp; Subtraction, returns&nbsp;<code>a - b</code></li>
<li><code>multiply(a, b)</code>&nbsp; Multiplication, returns&nbsp;<code>a * b</code></li>
<li><code>divide(a, b)</code>&nbsp; Division, returns&nbsp;<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>