← 返回 meta 的题目列表Basic Calculator with +, -, *, / Operators and Spaces
类型:online_judge
meta
Implement a basic calculator to evaluate a simple expression string. The expression string contains non-negative integers, '+', '-', '*', and '/' operators, and empty spaces. Integer division should truncate toward zero.
Example:
Input: "3+2*2" Output: 7
Input: " 3/2 " Output: 1
Input: " 3+5 / 2 " Output: 5
Example
Input
3+2*2