Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.32 KB

README_EN.md

File metadata and controls

49 lines (34 loc) · 1.32 KB
comments difficulty edit_url
true
Medium

中文文档

Description

rite methods to implement the multiply, subtract, and divide operations for integers. The results of all of these are integers. Use only the add operator.

You should implement following methods:

  • Operations()  constructor
  • minus(a, b)  Subtraction, returns a - b
  • multiply(a, b)  Multiplication, returns a * b
  • divide(a, b)  Division, returns a / b

Example:

Operations operations = new Operations();

operations.minus(1, 2); //returns -1

operations.multiply(3, 4); //returns 12

operations.divide(5, -2); //returns -2

Note:

  • You can assume inputs are always valid, that is, e.g., denominator will not be 0 in division.
  • The number of calls will not exceed 1000.

Solutions