mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 20:40:39 +08:00
纠正 0150.逆波兰表达式求值.md 的c++代码,将第21行代码的int修改为long long,原因:既然前面考虑到可能数据值大而将int改为了long long,那么最后的RPN运算结果也可能超过int能表示的范围
This commit is contained in:
@ -108,7 +108,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = st.top();
|
long long result = st.top();
|
||||||
st.pop(); // 把栈里最后一个元素弹出(其实不弹出也没事)
|
st.pop(); // 把栈里最后一个元素弹出(其实不弹出也没事)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user