Skip to content

Commit 338e3ac

Browse files
committed
更新calculator,删除没有必要的参数
1 parent 143940d commit 338e3ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

calculator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <iostream>
22
#include <stack>
33

4-
void TakeBlank(const std::string &expr, double &opera, size_t &pos) {
4+
void TakeBlank(const std::string &expr, size_t &pos) {
55
for (; pos < expr.size(); ++pos) {
66
if (std::isblank(expr[pos])) {
77
continue;
@@ -128,7 +128,7 @@ double EvalExpr(const std::string &expr, size_t &pos) {
128128
char op{};
129129
double opera{};
130130

131-
TakeBlank(expr, opera, pos);
131+
TakeBlank(expr, pos);
132132
if (pos == expr.size()) {
133133
Cal(opera_stack, op_stack);
134134
if (opera_stack.size() == 1 && op_stack.empty()) {

0 commit comments

Comments
 (0)