mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 11:21:42 +08:00
add leetcode problem-cn part2
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<p>Given an arithmetic equation consisting of positive integers, +, -, * and / (no paren­theses), compute the result.</p>
|
||||
|
||||
<p>The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should truncate toward zero.</p>
|
||||
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input: </strong>"3+2*2"
|
||||
<strong>Output:</strong> 7
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> " 3/2 "
|
||||
<strong>Output:</strong> 1</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> " 3+5 / 2 "
|
||||
<strong>Output:</strong> 5
|
||||
</pre>
|
||||
|
||||
<p><strong>Note:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>You may assume that the given expression is always valid.</li>
|
||||
<li>Do not use the eval built-in library function.</li>
|
||||
</ul>
|
Reference in New Issue
Block a user