Home > front end >  Js basic calculator algorithm
Js basic calculator algorithm

Time:03-12

Give you a string expression s, please implement a basic calculator to calculate and return its value,

Integer division retain only the integer part,

Example 1:

Input: s="3 + 2 * 2"
Output: 7
Example 2:

Input: s="l"
Output: 1
Example 3:

Input: s="3 + 5/2"
Output: 5



Js basic calculator algorithm

CodePudding user response:

Click the link above to go to solve your problem